[Solved] what happens if I call new in c++, but the heap is out of memory? [closed]


From “New and delete (C++)” on Wikipedia:

If not enough memory is available in the free store for an object of type T, the new request indicates failure by throwing an exception of type std::bad_alloc. This removes the need to explicitly check the result of an allocation.

2

solved what happens if I call new in c++, but the heap is out of memory? [closed]