rmoronsv

Untitled

Dec 24th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. case 'u':
  2. placeholder = ungets_index;
  3. while (ungets_index >= 0)
  4. operator_or_error_overread[index_error++] = ungets_string[ungets_index--];
  5. ungets_index = placeholder;
  6. break;
  7. case 'r':
  8. printf("Cleared ungets_string[]: %s\n", ungets_string);
  9. cleararray(ungets_string, ungets_index);
  10. printf("Current ungets_string: %s", ungets_string);
  11. ungets_index = 0;
  12. break;
  13. case '\n':
  14. mrp = pop();
  15. printf("\t%.8f\n", mrp);
  16. cleararray(ungets_string, ungets_index);
  17. ungets_index = 0;
  18. printf("Current ungets_string: %s", ungets_string);
  19. break;
  20.  
  21. void cleararray(char array[], int endofdata)
  22. {
  23. int i = 0;
  24. while (i <= endofdata)
  25. {
  26. array[i] = '\0';
  27. i++;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment