Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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++
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
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