Advertisement
Guest User

Untitled

a guest
Mar 31st, 2021
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.15 KB | None | 0 0
  1. struct Item {  
  2. std::string data;
  3. Item *next;
  4. };
  5. void destroyList(Item *head)
  6. {
  7. if (!head) return;
  8. destroyList(head->next);
  9. delete head;
  10. }
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement