passing structure arrays to functions?
Hi, I have a fairly particular question and I couldn't find the answer in any of my books. I'm trying to pass a structure array to a function and I've chosen to access structure members via "->".
Theres no problem compiling the interface file. However, I can't seem to pass the structure array to the function correctly in the main program. My syntax is incorrect. I know when passing a structure to a function we use the "&" to pass the address of the structure. But how would you pass a structure array to a function in main() so you can access structure members via ar[i]->member; ?
return_type function_name(struct X **ar)
for(i = 0; i < j; i++)
ar[i]->member = x;