PDA

View Full Version : struct initialisation in C


boris
05-23-2004, 04:17 PM
do i have to initialise a struct before i can pass it to a function?
and do i have to pass a pointer to the struct, or is it like arrays in that you pass the array name and that is sufficient?

shmoove
05-23-2004, 04:43 PM
A struct is just like a normal variable, not like a pointer (or an array which is really also a pointer). So the same rules that apply for any other primitive (like int, char, etc.) hold true.

shmoove