Untitled
public cpp v1 · immutable#include <iostream>#include <fstream>#include <string>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 }}int main() { string moo="test"; validerFichier(moo); inFile.close(); system("PAUSE"); return 0;}