I understand this probably a very basic question but nevertheless if you have a really simple linked list in c++ something like this...
class link{
link * next;
~link(void){
delete next;
}
}
If the destructor is called on the head of this linked list and its pointer to the next node is deleted does the destructor of the next node get called? Effectively would calling the destructor on the head deleted all the links in the list. Or would the rest of the list just hang there?
delete next
in the destructor of link. – NetVipeC