Question: Write a C++ program in which, read three c-string str from File. Now take input pat and rpat from user. Now your task is

Write a C++ program in which, read three c-string str from File. Now take input pat and rpat from user. Now your task is to find pat in str, replace pat with rpat in str if pat is found else display a message pat not found. EECE Example 1 Input: Str: abcdefabcdkuiyh Example 3 Input: Str: abcdefabcdkuiyh Example 2 Example 4 Input: Str: abcdefabcdkuiyh Input: Str: abcdefabcdkuiyh Pat: abcdefg Pat: abcd Pat: ab Pat: abc Rpat: xyz Output: After replace: Str: xyzefxyzkuiyh Rpat: xyz Output: After replace: Str: xyzcdefxyzcdkuiyh Rpat: xyz Output: After replace: Str: xyzdefxyzdkuiyh Rpat: xyz Output: Pat not found Str: abcdefabcdkuiyh
Step by Step Solution
3.46 Rating (153 Votes )
There are 3 Steps involved in it
include using namespace std int main string strstr1... View full answer
Get step-by-step solutions from verified subject matter experts
