memory allocation and freeing
Greetings,
Okay, heres two structures
:
Code:
struct TEST
{
char *var1;
DATA *data;
};
struct DATA
{
char *datavar;
};
lets say I allocate the memory and everything. When I get to the point that I need to free() it I have a questions.
lets say we have...
struct TEST test1;
if I free(test1); does it free *var1, and *data too? or do I need to seperately free them as well? also, if I were to... test1=NULL; will it NULL var1 and data too? or, again, do I need to do those seperatley?
Thanks, any help on these minor questions will be most appreciated, as well as any other insights.
-Jase