Write a function that has this prototype: int replace(char * str, char c1, char c2); Have the

Question:

Write a function that has this prototype:
int replace(char * str, char c1, char c2);
Have the function replace every occurrence of c1 in the string str with c2, and have the function return the number of replacements it makes.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

C++ Primer Plus

ISBN: 9780321776402

6th Edition

Authors: Stephen Prata

Question Posted: