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

c++
c++ a. Write a function called replace that takes as parameters one

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

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!