When I open a file in C, I am currently doing this:
int main()
{
FILE *f
f = fopen("employers.dat", "rb");
if(f == NULL)
{
PUTS("can not open the file:\"employers.dat\"");
fclose(f);
exit(-1);
}
return 0;
}
Is it necessary to use fclose
if the pointer is NULL
?