Can you delete an intire node that is a structure record, or do you have to delete each individual piece of data?
I declared link as a structure storing names and personal data. It doesn't like the fact that I attempt to delete an entire record at once. As far as what I've learned in class up to this point is that a node can contain any object you want. So if I can delete data in a node, why can I not delete an entire record? I get the below error when trying to compile.Code:linklist::~linklist() { link *current; current = head->next; while (current != NULL) { x++; cout << "delete node " << head->link[x] << endl; delete head; head = current; current = current->next; } cout << "Deleting last node " << head->link[x] << endl; delete head; }
(43): error C2273: 'function-style cast' : illegal as right side of '->' operator