How could you check to see if a file exists?
Printable View
How could you check to see if a file exists?
this is what i usually do:
Code:ifstream load("file.txt"); //open file
if (!load){ //if file does not exist
cout<<"Error: Cannot open file"<<endl;
return false;
}