ANSI C questions (parameters, structure assignment)
Henry Spencer
henry at zoo.toronto.edu
Fri Aug 24 01:40:13 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)?
When you pass a structure, it is passed by value, regardless of size.
> 2) Are structure assignments allowed only for initializations
>or can I do:
>struct_thing = other_struct_thing;
Yes, you can.
>struct_thing -= still_more_struct;
>struct_thing *= even_more_struct;
No; plain assignment (and the implicit assignments in passing and
returning) are the *only* operators that work on whole structures.
--
Committees do harm merely by existing. | Henry Spencer at U of Toronto Zoology
-Freeman Dyson | henry at zoo.toronto.edu utzoo!henry
More information about the Comp.lang.c
mailing list