Question: c++ a. Write a function called replace that takes as parameters one string, s1 and two characters c1,c2 and replace all the occurrences of c1
a. Write a function called replace that takes as parameters one string, s1 and two characters c1,c2 and replace all the occurrences of c1 in 51 with c2. For example, assume s1 is the string "This is first", c1 is " i ' and c2 is ' e ' then your function should modify s1 so that it contains: "Thes es ferst". b. Convert the function on a) using pointer notation c. Write a test program that will receive a string and two characters and display the string after replacing all the occurrences of c1 with c2. Use pointer notation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
