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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started