int *arr = (int *) malloc(sizeof(int) * 10); // array of length 10
if (!arr) { // Failed
}
int arr[1999999999];
if (!arr)
;
try
{
a = new char[10];
}
catch (…)
{
cout << "I'm screwed?" << endl;
}
int foo;
try {
foo = new int[1000000]; // 4gig RAM
} catch( OutOfMemoryException e ) {
foo = new int[250000]; // 1gig RAM
}
catch( const std::bad_alloc &ex )
Thanks!