I am just starting to learn C and (of course) struggling with pointers :)
Given this snippet:
int *storage, *storage_p;
storage = malloc(sizeof(int[GROW_BY]));
storage_p = storage;
// do something with storage, using storage_p
free(storage);
storage = NULL;
Is it really necessary to have two variables declared to work with the malloc()
'ed data? Is it good practice to create a storage
and storage_p
the way I did? If not, what would would be 'the way'?