Struct parameters
Structs in C behave exactly like ints and chars in Java.
In declaring a variable of some struct type, no reference is created.
A struct variable is passed by value.
typedef struct { � } Pair;
void fv (Pair p)
{p.a= 42;}
void main (void) {
Pair pr;
pr.a= 17;
pr.ch= �?�;
fv(pr)
}
Previous slide
Next slide
Back to first slide
View graphic version