Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool ContactList::remove(const std::string& key)
- {
- NodePtr *pp = &head;
- while (*pp)
- {
- if ((*pp)->data.key == key)
- {
- NodePtr *tmp = *pp;
- *pp = tmp->link;
- delete tmp;
- return true;
- }
- pp = &(*pp)->link;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement