Skip to content

Instantly share code, notes, and snippets.

@erik
Created February 12, 2011 18:04
Show Gist options
  • Save erik/823941 to your computer and use it in GitHub Desktop.
Save erik/823941 to your computer and use it in GitHub Desktop.
void list::clearList( node*& ptr )
{
node* doom = ptr;
while ( ptr != NULL )
{
doom = ptr->next;
delete ptr;
ptr = doom;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment