What is the problem when we throw a pointer in C++. For example in below code, what happened for exception object?
class Box {
....
};
int main()
{
try
{
throw new Box();
}
catch(Box* b)
{
...
}
}
What is the problem when we throw a pointer in C++. For example in below code, what happened for exception object?
class Box {
....
};
int main()
{
try
{
throw new Box();
}
catch(Box* b)
{
...
}
}