Hi all"
I have a quick question for you:
I have something like the following:
Code:
typedef struct recordinfo
{
int ind;
char *str;
} recordinfo1;
and somewhere in the code i do the following:
Code:
users = (struct recordinfo *) malloc ( sizeof(struct recordinfo) * 2000 );
after running the one cycle in a loop, I would like to free the memory that I allocated.
I do the following:
Code:
free ((recordinfo *) users );
but that doesn't free everything because inside recordinfo another pointer (char *str).
do you know how to free all the memory allocated for this array?
Thanks
Jimmiy