Hi, new to these boards and they seem like a great place to spend some time. I have a question about double pointers to structs that I'm hoping someone can help me out with. If I have a double pointer to an array of structs, how can I get at a member of the nth struct?
Let me explain that in code. The func is a struct:
But, that doesn't compile. So, how do I dereference the double pointer and get myself a struct to work with. I feel like I'm just missing a subtlety in the syntax.
func ** functions = xmalloc( foo * sizeof( func * ) );
unsigned int numDone = 0;
while( i = 0; i < bar; ++i )
*( func + numDone++ ) = makeFunc(); //returns a func *
//print the member "numInsts" from the nth function:
printf( "%u\n", *(*(func + n )).numInsts );
Thanks for any help,