#include <new> try{ int* arr= new int[100000000];}catch (std::bad_alloc& exc){ // Error aquí}
char* array = new (std::nothrow) char[30];if (array == NULL) { // Errror}