// bad_alloc.cc #include using namespace std; int main() { int* p = new int[-10]; p[0] = 42; delete[] p; }