rmoronsv

Untitled

Dec 26th, 2019
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. case 'u': //places everything before 'u' in the line of input where 'u' was
  2. printf("%s\n", ungets_string); //prints the string we are attaching to getchxungetchx
  3.  
  4. placeholder_gi = gi - 1; //where the string ungets_string will be attached
  5.  
  6. while (getchxungetchx[gi] != '\n') //stores everything after u
  7. {
  8. temparray[ti] = getchxungetchx[gi++];
  9. ti++;
  10. }
  11. temparray[ti] = '\n';
  12. printf("%s\n", temparray);
  13.  
  14. placeholder = ungets_index; //uses a variable to decrement to 0 the elements of ungets_string
  15.  
  16. while (placeholder >= 0) //HERE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  17. {
  18. getchxungetchx[placeholder_gi] = ungets_string[placeholder];
  19. placeholder_gi++, placeholder--;
  20.  
  21. printf("%c\n", ungets_string[placeholder]);
  22. printf("%se\n", getchxungetchx);
  23. printf("0\n");
  24. }
  25.  
  26. printf("%s\n", getchxungetchx);
  27. ti = 0;
  28.  
  29. while (temparray[ti] != '\n') //reattaches temparray
  30. {
  31. getchxungetchx[placeholder_gi] = temparray[ti];
  32. ti++, placeholder_gi++;
  33. }
  34. gi = placeholder_gi;
  35. cleararray(temparray, ti);
  36. getchxungetchx[gi] = '\n';
  37. printf("%s\n", getchxungetchx);
  38. break;
Advertisement
Add Comment
Please, Sign In to add comment