Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 'u': //places everything before 'u' in the line of input where 'u' was
- printf("%s\n", ungets_string); //prints the string we are attaching to getchxungetchx
- placeholder_gi = gi - 1; //where the string ungets_string will be attached
- while (getchxungetchx[gi] != '\n') //stores everything after u
- {
- temparray[ti] = getchxungetchx[gi++];
- ti++;
- }
- temparray[ti] = '\n';
- printf("%s\n", temparray);
- placeholder = ungets_index; //uses a variable to decrement to 0 the elements of ungets_string
- while (placeholder >= 0) //HERE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- {
- getchxungetchx[placeholder_gi] = ungets_string[placeholder];
- placeholder_gi++, placeholder--;
- printf("%c\n", ungets_string[placeholder]);
- printf("%se\n", getchxungetchx);
- printf("0\n");
- }
- printf("%s\n", getchxungetchx);
- ti = 0;
- while (temparray[ti] != '\n') //reattaches temparray
- {
- getchxungetchx[placeholder_gi] = temparray[ti];
- ti++, placeholder_gi++;
- }
- gi = placeholder_gi;
- cleararray(temparray, ti);
- getchxungetchx[gi] = '\n';
- printf("%s\n", getchxungetchx);
- break;
Advertisement
Add Comment
Please, Sign In to add comment