#include<iostream>
using namespace std;
bool FileExists(const string &filename) {
if (FILE * file = fopen(filename.c_str(), "r")) {
fclose(file);
return true;
}
return false;
}
int main(){
cout << FileExists("myfil.cpp") << endl;
return 0;
}
编译运行