This question already has an answer here:
- Why use new and delete at all? 8 answers
I have allocated memory to object using new, calling function through that object withing if statement then where should i use delete keyword?
class *obj =null;
obj = new class();
if(failed(obj->Add()))
{
cout<<"function call failed";
}
Aucun commentaire:
Enregistrer un commentaire