Jul 19, 2011 at 3:32pm
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..
Jul 19, 2011 at 5:17pm
Revise the example so that it destroys nodes upon exit. this is what i must do.
Jul 19, 2011 at 9:43pm
Last edited on Jul 19, 2011 at 9:43pm
Jul 19, 2011 at 10:15pm
so basiclly. ~node() {delete next;}
Jul 20, 2011 at 10:50am
Pretty much yes, just be sure you don't delete memory thats not yours (NULL/Uninitialized)
Jul 20, 2011 at 11:02am
well then giveme a code that only deltes the memory used by this program.
Jul 20, 2011 at 11:06am
Wouldn't you gain more from it if you figured it out on your own?
Jul 20, 2011 at 12:10pm
true, but my comp is already pretty fucked up, so i dont wanan fuck it up even more.
Jul 20, 2011 at 1:18pm
'comp' is short for what?
Your code is fine. Whether you have any problems with it depends on how you use it.
Jul 20, 2011 at 1:52pm
You can't fuck up your computer this way.
Jul 20, 2011 at 4:46pm
not a homework. self study. school doesent teach this.