/* sample program for file exists */
#include <stdio.h>
bool isfileExists(const char* fileName) {
FILE *fp;
if(fp = fopen(fileName,"r"))
{
fclose(fp);
return 1;
}
return 0;
}
int main()
{
if (isfileExists("sample.cpp"))
printf("File exists\n");
else
printf("File does not exists\n");
return 0;
}