#include <stdexcept>
class A
{
public:
~A(){ }
};
class B
{
A *a;
public:
B() {
try {
a = new A[100];
throw std::logic_error("oups");
}
catch(...){ throw; }
}
~B(){ delete [] a;}
};
int main()
{
try {
B b;
A a[10];
A *a2 = new A();
delete a2;
} catch(...) { }
return 0;
}
Login in to like
Login in to comment