type * darray;
darray = new type [size];
//bug occurs here:
if(darray)
delete [] darray;
🔒 Locked
bloody memory bug
Advertisement
Original Post
What instances would this code produce an illegal operation?
Can a pointer return a true or false statement ? I mean r u allowed to put pointers in boolean expressions ? Because thats what u r doing: --------> if(darray)
______________________________
My Website: [link]www.antondev.tk[/link]
or directly at http://home.attbi.com/~antonweb/
"I''ve read about...doom being used to manage unix programs(you "kill" the processes)" dede
______________________________
My Website: [link]www.antondev.tk[/link]
or directly at http://home.attbi.com/~antonweb/
"I''ve read about...doom being used to manage unix programs(you "kill" the processes)" dede
Yes, you can test pointers, or any other variables against 0.
Height Map Editor | Eternal Lands | Fast User Directory
Height Map Editor | Eternal Lands | Fast User Directory
quote:
-run until the line of creation and see what is the number inside the size. if it is odd, then probrably there is the error.
Would it really give an error if it were odd? Why?
quote:I think Filami means "odd" as in "unusual".
Original post by llvllatrix
Would it really give an error if it were odd? Why?
Its the oddest thing. Actually the code is in a milkshape exporter that i wrote. Its just for this one model that it screws up. Ultimately, the file it produces is fine. Its just that for this one file, when i try to delete the triangle array, i get the illegal opperation.
I got the file though...really all i cared about
but i was just wondering if there was some wierd thing i didn''t know about that was messing with my code...probably just my pc - its starting to die now, going to have to format soon
I got the file though...really all i cared about
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement