How to check a file is opened or not if i forgot to assign null to file pointer
c, file-io
Solution
You can't. The value of `fp` after closing it is indeterminate: http://www.iso-9899.info/n1256.html#7.19.3p4
This means any operation on it results in undefined behaviour.
Problem
I have opened a file ``` FILE *fp = fopen("file.txt","r"); fclose(fp); ``` scenario is that I forgot to assign null to `fp` Now I want to check whether this file is open or not using same `fp` pointer