Question: WRITE A C++ PROGRAM FOR THE FOLLOWING PROBLEM YOU ARE ASKED TO DEVELOP A C++ PROGRAM USING C STRINGS THE PROGRAM SHOULD DISPLAY THE REQUIRED

WRITE A C++ PROGRAM FOR THE FOLLOWING PROBLEM YOU ARE ASKED TO DEVELOP A C++ PROGRAM USING C STRINGS THE PROGRAM SHOULD DISPLAY THE REQUIRED OUTPUT YOU ARE NOT ALLOWED TO USE ANY SECOND ARRAY OR USE CONTINUE BREAK SWITCH STATEMENT IN BRIEF THE PROGAM SHOULD ASK THE USEER TO ENTER THE MAIN STRING THAN IT SHOULD ENTER THE FIND STRING THAN IT SHOUD ASK THE REPLACE STRING IT SHOULD BE A GENERAL PROGRAM THAT WORKS FOR ANY STRING AND PLEASE DO ANSER IF YOU COULD DEVELOP A PROGRAM FOR THE REQUIRED PROBLEM PLEASE DONOT JUST DISPLAY THE OUTPUT AS IT WOULD BE JUST A WASTE OF TIME FOR US I AM JUST GIVING THE HEADER FILE AND THE FUNCTION PROTOTYPES FOR ONLY YOUR CONVENIENCE AS YOU ARE NOT ALLOWED TO USE ANAY SECOND ARRAY

IT SHOULD DISPLAY THE FOLLOWING OUTPUT

For example: mainString: I love computing. It is so much fun

findString: computing

replaceString: Lahore

mainString changes to: I love Lahore. It is so much fun

Another example: mainString: I love computing. It is so much fun

findString: fun

replaceString: going to the library

mainString changes to: I love Lahore. It is so much going to the library

QUESTION

Implement the find and replace function similar to MS word. You have to find the first matching instance of the 'findstring' with the 'replacestring' in the 'mainstring'. For example: mainString: I love computing. It is so much fun findString: computing replaceString: Lahore mainString changes to: I love Lahore. It is so much fun Another example: mainString: I love computing. It is so much fun findString: fun replaceString: going to the library mainString changes to: I love Lahore. It is so much going to the library

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!