ANSI C questions (parameters, structure assignment)

R. Kym Horsell vu0310 at bingvaxu.cc.binghamton.edu
Thu Aug 23 07:59:22 AEST 1990


In article <1081.26d26274 at desire.wright.edu> demon at desire.wright.edu writes:
>
>	1)	In standard C, when you pass a structure bigger than four
>longwords, is the structure passed as a value parameter, or just a pointer to
>the structure (thus making it a var parameter)?

I std doesn't care much about 2 bytes, 4 bytes, etc. When you
*ask* for a struct to be passed by value you *get* it otherwise
your code would probably upchuck.

>
>	2)	Are structure assignments allowed only for initializations
>or can I do:
>
>struct_thing = other_struct_thing;

Sure.

>struct_thing -= still_more_struct;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^?

How should a struct be interpreted as a number (even if it contains only 
a single numeric field)? No, this isn't valid.

-Kym Horsell



More information about the Comp.lang.c mailing list