One of the first parts of the Unix operating system, developedin August 1969, was ed a line editor. Some have describedit as “the most user-hostile editor ever created” as ed is reallydifficult to use!
Here, we would like to develop a very simple line editor thatonly acts on one initial line of text. The user can then eitherdelete a substring from that line, or insert a string into it.
Write program line_editor.c that implements a line editorsupporting deletion and insertion, as illustrated in the followingexample:
_____________________________________________________________________________________________________________________________
$ ./line_editorEnter the source string:Hello worldSource string is: ‘Hello world’Enter [Dd] (delete), [Ii] (insert) or [Qq] (quit):iEnter string
PayPal Gateway not configured
PayPal Gateway not configured