View Full Version : free delete crash?

03-13-2002, 01:03 PM
i have
GLubyte *ImageData;

then in the deconstructor i have
free(ImageData); but it crashes any ideas?

And from my knowledge i believe
free is for vars and
delete is for class's
yet i have seen them interchanged, does anyone know the exact definitions, that someone like me would understand http://www.opengl.org/discussion_boards/ubb/smile.gif

03-13-2002, 01:51 PM
Try asking this beginner C++ question in a more appropriate forum.

03-13-2002, 01:55 PM
Unfortunately this is way offtopic, but I can give you some hints:

free() should be used together with malloc()
delete should be used with new

And you should learn the basics of C++ before diving straight into the middle of the programming sea.

FAQ (http://www.parashift.com/c++-faq-lite/) you!

(inside joke)

[This message has been edited by richardve (edited 03-14-2002).]

03-14-2002, 06:16 AM
I tried but no one seemed to know befor and everywhere i looked people just confuse me by throwing them in everywhere and not for what i though was true and u just said was true, and thats basically what i though they should be used for.