// File: SimpleIO.cpp // Example of catching exception // Array access out of bounds... #include #include using namespace std; int main() { int list[]={1,2,3,4,5,6,7,8,9,10}; cout << "Enter an index to print >"; int idx; cin >> idx; try { cout << list[idx]; } catch (exception &e) { cout << "Standard exception: " << e.what() << endl; } return(0); }