C program not c Write a rudimentary text editor that allows

C program not c++

Write a rudimentary text editor that allows the user to edit 5 lines of text, where each line is no longer than 80 characters. The editor should allow the user to continue editing as long as desired and should print the current state of the edit buffer after each edit.

The editor is a \'line editor\' in that the user must edit one line at a time. The user can specify which line should be edited by choosing a line number from a menu.   

The only two editing operations possible are to replace an entire line with a new line, or to replace a substring in the line with a new substring.

Use these functions and edit them:

Solution

#include #include #include char* substring(char*, int, int); int main() { char string[100], *pointer; int position = 1, length = 1, temp, string_length; printf(\"Enter a string\ \"); gets(string); temp = string_length = strlen(string); printf(\"Substring of \\\"%s\\\" are\ \", string); while (position <= string_length) { while (length <= temp) { pointer = substring(string, position, length); printf(\"%s\ \", pointer); free(pointer); length++; } temp--; position++; length = 1; } return 0; }
C program not c++ Write a rudimentary text editor that allows the user to edit 5 lines of text, where each line is no longer than 80 characters. The editor shou

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site