Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
ZoidBob1327y@Pseudonymous Self proclaimed if nothing else, his instagram, twitter and website say that he's a dev
-
I don't know what is the type of head, but if it is a node object he could write the node's destructor like this so everything will work.
~Node() {
//deletes data field and
//if the next node is not null
//deletes the next node
} -
Our professor told us to do exactly that in our clear method.
Difference is that it's C# and we have no way to manually destroy nodes :(
Related Rants
-
l0om44100% Real. And it's not even the worst on the site.
-
Codazed11Being 100% serious, I saw a guy in my Computer Programming I class using MS Word to write code that he would c...
-
dfox8I worked with a good dev at one of my previous jobs, but one of his faults was that he was a bit scattered and...
Making our own linked list class in C++
This is how he deleted his list in the destructor
~myList() {
delete head;
}
Gets a couple of points off, blames the prof for biased marking
rant
wk99