🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #6218

Re: const and struct pointers

#6218
From: Randy Hutson
Date: Sat, 24 Feb 1990 12:36
15 lines
1287 bytes
In message <90054.232325CMH117@psuvm.psu.edu> CMH117@psuvm.psu.edu 
(Charles Hannum) writes:


>The double is passed by value; so dereferencing it works fine.  But the
>struct is passed by reference (as are *all* structures in C!).  In reality,
>you need to pass a "struct qwert *" to the function.  Normally, the compiler
>takes the reference automatically, but you are trying to do this in reverse.
>Thus, it does not work; you simply can't pass a structure by value.

The original poster said his compiler claimed to be ANSI compliant.  ANSI
C allows structures to be assigned, returned by functions, and passed by
value to functions.  However, some non-ANSI compilers may do as you have 
said with struct function arguments.
Technical Details
Message-ID: <4325@helios.TAMU.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!helios!csseq!randy
References: <1214@watserv1.waterloo.edu> <90054.232325CMH117@psuvm.psu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!helios!csseq!randy
From: randy@csseq.tamu.edu (Randy Hutson)
Newsgroups: comp.std.c,comp.lang.c
Subject: Re: const and struct pointers
Message-ID: <4325@helios.TAMU.EDU>
Date: 24 Feb 90 12:36:00 GMT
References: <1214@watserv1.waterloo.edu> <90054.232325CMH117@psuvm.psu.edu>
Sender: usenet@helios.TAMU.EDU
Reply-To: randy@csseq.tamu.edu (Randy Hutson)
Followup-To: comp.std.c
Distribution: all
Organization: Computer Science Dept., Texas A&M University
Lines: 15