G
Guest
I have this code:
---------------------
try {
int *a = new int[1000000000];
} catch (...)
{
cout << "oh no!"; exit(0);
}
----------------------
new returns 0 but no exception occur in this error. Why?
============
I learn today about auto_ptr. What is the use of this? (I have not
understand it well)
if I want automatic deletion of int array inside a class constructor on
exception I must use it like this?
---------------------
try {
int *a = new int[1000000000];
} catch (...)
{
cout << "oh no!"; exit(0);
}
----------------------
new returns 0 but no exception occur in this error. Why?
============
I learn today about auto_ptr. What is the use of this? (I have not
understand it well)
if I want automatic deletion of int array inside a class constructor on
exception I must use it like this?