1 // operator new(unsigned) 2 // operator new[](unsigned) 3 // operator new(unsigned, std::nothrow_t const&) 4 // operator new[](unsigned, std::nothrow_t const&) 5 6 #include <stdlib.h> 7 8 #include <new> 9 10 using std::nothrow_t; 11 12 // A big structure. Its details don't matter. 13 typedef struct { 14 int array[1000]; 15 } s; 16 main(void)17int main(void) 18 { 19 s* p1 = new s; 20 s* p2 = new (std::nothrow) s; 21 char* c1 = new char[2000]; 22 char* c2 = new (std::nothrow) char[2000]; 23 delete p1; 24 delete p2; 25 delete [] c1; 26 delete [] c2; 27 return 0; 28 } 29 30 31