SHARE
TWEET

Untitled

razvanth21 Mar 23rd, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while(fgets(buff, 32, h) != NULL)
  2.     {
  3.         k = 0;
  4.         buff[strlen(buff) - 1] = '\0'; // scapa de \n
  5.  
  6.         if(!strcmp(buff, "backspace"))
  7.         {
  8.             x = head;
  9.             while(x)
  10.             {
  11.                 x = x->next;
  12.                 cpy[k] = x->data;
  13.                 k ++;
  14.             }
  15.  
  16.             printf("DEBUG: backspace called. Copy is: %s\n", cpy);
  17.  
  18.             backspace(&head);
  19.         }
  20.  
  21.         else if (strstr(buff, "move") != NULL)
  22.             move(atoi(buff + 5), &head);
  23.  
  24.         else if (strstr(buff, "copy") != NULL)
  25.             copy(&head, atoi(buff + 5));
  26.  
  27.         else if (strstr(buff, "insert") != NULL)
  28.             adaugare_rand(&head, buff + 7);
  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