Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Item {
- std::string data;
- Item *next;
- };
- void destroyList(Item *head)
- {
- if (!head) return;
- destroyList(head->next);
- delete head;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement