I have two scenarios
Object* obj = Vector[0]; delete obj;
Versus
delete Vector[0];
I’m told the later causes memory leak and array out of bounds. How? Doesn’t both methods point to the same pointer?
Aucun commentaire:
Enregistrer un commentaire