I have the following method:
class MyClass
{
public:
MyClass;
bool method (MyClass &obj);
};
void MyClass::method (MyClass &obj)
{
MyClass *c = new MyClass;
try{
//code
//access another method
return true;
}
catch (std::string s)
{
}
return false;
}
Where should I delete the pointer c
to the object from MyClass:
before return true
or before return false
?