I have question about checking if file exists or not. Which option is better?
source=fopen("text.txt","r");
if(source != NULL)
{
printf("File Exists!\n");
exit(0);
}
or to use
if (source)
{
printf("File Exists!\n");
exit(0);
}
I have question about checking if file exists or not. Which option is better?
source=fopen("text.txt","r");
if(source != NULL)
{
printf("File Exists!\n");
exit(0);
}
or to use
if (source)
{
printf("File Exists!\n");
exit(0);
}