Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 13 Nov 2012
Offline Last Active Nov 13 2012 12:50 PM

Topics I've Started

wierd linked list deletion problem

13 November 2012 - 12:52 PM

I am having a weird problem were i have a linked list system that creates objects and it works fine until i add any numeric variable to the main loop then it crash when it is deleting the objects

while (1)//this deletes the objects
		if (root->next != NULL)
			delete root;
			root = temp;

This next part is the beginning of the main loop it works fine until i added the variable "test" after i added it, it crashes whenever i try to delete the whole list using the code above.

int main()
	int test = 0;
	zombie master;
	zombie *root = &master;
	zombie *temp=NULL;