Return of arrays and structures,...efficiency/clarity/consistency,...
Rick Burgess
rburgess at milton.u.washington.edu
Thu Apr 18 03:39:14 AEST 1991
Two questions:
Novice question: Apparently values of structures can be returned
from functions under the ANSI standard...? Can
Arrays also? Aren't structures essentially a
pointer constant just like arrays? When you
pass a structure and not a structure pointer
aren't you gonna end up with the version modified
in the routine it is passed to just like with
arrays?
Programmer question: Can anyone give some logical or anectdotal suggestions
on when pointers are well used, when structures and
arrays themselves, and when it is actually good to
return either or both of these rather than just
letting them be modified directly by the subroutine?
(I know, I should probably take a compsci course, right?)
More information about the Comp.lang.c
mailing list