I have a question about deleting objects(the objects are stored in a vector)
I Fill the vector as following:
Expand|Select|Wrap|Line Numbers
- servObj.push_back(new CGame(serversh, game_id)); (1)
If I try to delete the first object that was stored in servObj like this:
Expand|Select|Wrap|Line Numbers
- delete &(servObj.at(0));
Now my question is, if I just erase the first element, will it cleanly destroy the object that was stored in the first element?
So:
Expand|Select|Wrap|Line Numbers
- servObj.erase(itservObj);
I havnt been coding in C++ for that long(read: never had to bother with memory management) so I would appreciate anyone pushing me in the right direction here.
Thanks in advance