COMMONS in C

Henry Spencer henry at utzoo.uucp
Tue Mar 20 07:36:45 AEST 1990


In article <22944 at unix.cis.pitt.edu> rothen at unix.cis.pittsburgh.edu (Seth B Rothenberg) writes:
>... someone told me recently that the order of the variables in 
>memory is not always the same as the order of the variables in the 
>structure.   Is this true?

Both K&R1 and ANSI C say the order must be preserved.  There are probably
compilers that don't do this, however.

>Based on the way structures can be initialized, I think the
>person I spoke with is mistaken.

Structure initialization has no bearing on the question, since the compiler
need only rearrange the order of elements in the initializer to match.
-- 
MSDOS, abbrev:  Maybe SomeDay |     Henry Spencer at U of Toronto Zoology
an Operating System.          | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list