One of the major differences between K&R and ANSI C was this exact point.
In K&R you couldn't pass a structure as an argument.  You could pass a
pointer
to a structure but not the structure itself.  In ANSI C you *can* pass a
structure: either as a parameter or a return value.

The comment about large structures resulting in a lot of data being pushed
onto the stack is very true.  This is why in C++ you can pass a reference,
and ideally a "const reference".

Dave.

--
Dave Smith
Colorado Springs, CO USA

Reply via email to