I wish to know what happens to FILE pointer after the file is closed. Will it be NULL?
Basically, I want to check if a file has already been closed before closing a
FILE * It's a pointer to a FILE structure, when you call fclose() it will destroy/free FILE structure but will not change the value of FILE* pointer means still it has the address of that FILE structure which is now not exits.
same things happem with any pointer getting with malloc
int a malloc(10);
free(a);
still a will not be NULL
in most case i always do this things
free(a);
a=NULL;
Edit: you can not check whether its CLOSED/freed at any time. just to make sure you can assign it NULL after free/fclose so you can check its NULL or not and go ahead ..