Delete objects?

Hi, I'm trying to write a chess program (human v. human) and want to delete the pieces once they've been captured but I think I dont understand something correctly. I have a parent class of chess pieces, then a daughter class of each type of chess piece. I also have a class "square" which can contain a pointer to a chessPiece object and a bool value representing whether or not it's occupied.
I currently am just giving captured pieces coordinates outside the board, but I'd rather actually get rid of them if possible, at least so I can learn more about how objects and pointers work.
So i guess just, is it possible to delete/destruct/free from memory an object if I don't want the chessPiece objects to be pointers themselves(and hence I don't want to declare them using the "class newobject = new class" form)? Just because I would ahve to change a huge percentage of my code just for this and I'd rather not do that unless thats really how it should work.
I've looked up destructors and the delete keyword and it looks like the delete keyword only applies to pointers, but I couldn't find a useful description of how destructors work which didn't use the example of an object declared using the 'new' keyword.
You can't delete anything manually, until you also allocated memory manually.
So, no delete without new :)

If I were you, I would store pieces in vector. It's easy to manage, and you can also use functions like erase() (http://www.cplusplus.com/reference/vector/vector/erase/ ) to "delete" piece from vector.

Cheers!
Drat. Well ok, I'll look into that. Thank you:)
Topic archived. No new replies allowed.