Original Post
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
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.
while (1)//this deletes the objects
{
if (root->next != NULL)
{
temp=root->next;
delete root;
root = temp;
}
else
{
break;
}
}
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;