I hope I\'m not being too desperate, but I really, REALLY need helpon my C++ cod
ID: 3617419 • Letter: I
Question
I hope I'm not being too desperate, but I really, REALLY need helpon my C++ code.I did this code to delete all sprites from a linked list and I keepgetting an error! The program runs fine and all, but when I closeit, it gives me this message:
"Unhandled exception at 0x0033aad1 in asgmt03.exe: 0xC0000005:Access violation reading location 0xfeeefeee."
And it directs me to this code:
do
{
deletesprites->sprite;
delete sprites;
sprites =sprites->next;
}
while(sprites != 0);
It's a C++ Space Invader Program and I'm suppose to be creating alinked list. I did the assignment but I'm not able to fix theerror. Please help.
Here are the links to the code:
http://www.box.net/shared/il5302f9qx
http://www.box.net/shared/qu8glnn1ue
Thank you!
Explanation / Answer
Node *newnode; while(sprites != 0) { newnode=sprites->next; deletesprites->sprite; delete sprites; sprites = newnode; }