array of structs
I have a struct. I want to declare a pointer to that struct. Now I want 10 of those structs. How is this declared? I have tried (call the struct foo for example):
foo* test[10];
when I make a call to test[0]->whatever or test[5]->whatever it seems to always write to the first element (the 0th of the array).
I think what I'm getting is an array of pointers. I want a pointer to an array of structs.
How do I delare this? Thanks.
Nemoticchigga
Junior Poster in Training
98 posts since Feb 2008
Reputation Points: 10
Solved Threads: 2
Thanks all.
MrSpigot, how would I then access the structs through the pointer?
pFoo->test[0].index = blah; does not work. How would this be done?
Thanks.
Nemoticchigga
Junior Poster in Training
98 posts since Feb 2008
Reputation Points: 10
Solved Threads: 2