Answered step by step
Verified Expert Solution
Link Copied!

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++
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions