#include #include #include using namespace std; int main() { try { ifstream fin; fin.open("C:\\nonexistant.txt"); if (fin.fail()) throw string("Hm. That failed."); int a; fin >> a; cout << a << endl; } catch (string errorMessage) { cout << "The error was: " << errorMessage << endl; } return 0; }