this one has had me stumped for at least the past 2 hours.
i am working on a simple genetic algorithm program with two types of creatures( predator and prey ) both derived from a base class creature.
inside of my world manager class i have 2 pointer arrays, one holding pointers to predators and one holding pointers to prey.
i also have a delete function that accepts a pointer to a creature ( the base class ) and deletes the pointer and sets it to NULL.
whenever a creature dies, however, the pointer isnt completely deleted. i have tried changing the delete function to accept pointers to predators and preys instead of creatures but i get the same problem.
my delete function is merely:
if you need any more code to solve the problem, let me know...Code:void Delete( Creature * creature ) { delete creature; creature = NULL; }