#include #include #include //for classes bad_alloc and bad_array_new_length using namespace std; int main() { //Get a block of memeory big enough to hold an array of 100 ints. int *const p {new(nothrow) int[100]}; //or try it with 2147483647 if (p == nullptr) { cerr << "Unable to allocate memory.\n"; return EXIT_FAILURE; } p[0] = 1234; cout << "p[0] = " << p[0] << "\n"; delete[] p; return EXIT_SUCCESS; }