#include using namespace std; int main() { try { int* ptr = new int[9982381213]; // too big? cout << "Created memory." << endl; delete[] ptr; } catch (bad_alloc) { cout << "Failure to allocate memory." << endl; } return 0; }