Hi,
I am a bit confused about passing struct in C. Is it passing the entire struct or its just passing an pointer to itself. Thanks for any help.
Hi,
I am a bit confused about passing struct in C. Is it passing the entire struct or its just passing an pointer to itself. Thanks for any help.
U can pass a pointer to the strucure u r interested in, to a function . Any standard book must explain that.
In the middle of difficulty, lies opportunity
Well perhaps you need to go read "any standard book" then. It works both ways.It just depends on what way you want to go about it.Code:void passbyvalue( struct foo bar ) { /* a copy of the structure is passed */ } void passbypointer( struct foo *bar ) { /* pass the address of the structure to the function */ }
Quzah.
Hope is the first step on the road to disappointment.