#include #include #include using namespace std; void validerFichier(string nomFichier){ ifstream inFile; inFile.open(nomFichier); if (!inFile) { cout << "Unable to open file\n"; exit(1); // terminate with error } inFile.close(); } int main() { string moo="test.txt"; validerFichier(moo); system("PAUSE"); return 0; }