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;