Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Delete ( struct list **current, const int data )
- {
- struct list *tmp = *current;
- struct list *prev = NULL;
- while ( tmp != NULL )
- {
- struct list *next = tmp->next;
- if ( tmp->age == data )
- {
- free( tmp );
- if ( prev )
- {
- prev->next = next;
- }
- else
- {
- *current = next;
- }
- }
- else
- {
- prev = tmp;
- }
- tmp = next;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement