SHARE
TWEET

Remove Node3

a guest Apr 21st, 2019 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Delete ( struct list **current, const int data )
  2. {
  3.     struct list *tmp  = *current;
  4.     struct list *prev = NULL;
  5.  
  6.     while ( tmp != NULL )
  7.     {
  8.         struct list *next = tmp->next;
  9.         if ( tmp->age == data )
  10.         {
  11.             free( tmp );
  12.  
  13.             if ( prev )
  14.             {
  15.                 prev->next = next;
  16.             }
  17.             else
  18.             {
  19.                 *current = next;
  20.             }
  21.         }
  22.         else
  23.         {
  24.             prev = tmp;
  25.         }
  26.  
  27.         tmp = next;
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top