I have a struct in my c code of about 300Bytes (5xint + 256chars), and I wish to have a good mechanism of array for handling all my 'objects' of this struct. I want to have a global array of pointers, so that at first all indices in the array points to NULL, but then i initialize each index when I need it (malloc) and delete it when im done with it (free).
typedef struct myfiles mf;
mf* myArr[1000];
Is that what Im looking for? Pointers mixed with arrays often confuse me. If so, just to clerify, does
mf myArr[1000];
already allocates 1000 structs on the stack, where my first suggestion only allocates 1000pointers?