What will be the status of an object pointer when a new class constructor throws an exception in C ++? Take the following code, for example:
CMyClass * pobjMyClass = (CMyClass *)0xA5A5A5A5;
try
{
pobjMyClass = new CMyClass(); // Exception thrown in constructor
}
catch ( ... ) {}
When does this code execute what will mean pobjMyClassafter the exception is thrown? A pointer to an invalid copy of CMyClass, 0xA5A5A5A5, NULL, some random uninitialized value, or something else? Thank.
source
share