STUDENT ** list=NULL;
char *getid;
getid =(char*)malloc(sizeof(char) * 8);
printf("How many student? ");
int menuNum,num=0;
scanf("%d",&num);
list=(STUDENT**)malloc(num*sizeof(STUDENT*));
I used pointer like this. As I learned from the professor, before finishing my code, I ought to use free() function to retrieve the allocated memory again.
Here s what i wanna ask you.
I learned that If i wanna use free() about (char *getid)
I know I should write
free(getid);
then How can I use free about
STUDENT ** list = NULL ; // **It's about struct**
Should I use like
free(list);
or
free(*list);
I think the former is right, but when I write like the latter, there's no error on my X-code.
Could you tell me about it ?