Firstly, the destructor you posted doesn't have ~, though that might have been a typo.
Do you need to delete next ? I don't see where the problem is..
Revise the example so that it destroys nodes upon exit. this is what i must do.
Last edited on
so basiclly. ~node() {delete next;}
Pretty much yes, just be sure you don't delete memory thats not yours (NULL/Uninitialized)
well then giveme a code that only deltes the memory used by this program.
Wouldn't you gain more from it if you figured it out on your own?
true, but my comp is already pretty fucked up, so i dont wanan fuck it up even more.
'comp' is short for what?
Your code is fine. Whether you have any problems with it depends on how you use it.
You can't fuck up your computer this way.
not a homework. self study. school doesent teach this.