Question: Can someone help me . This program needs to run in visual studio and written in c++. I want to call to the function string

Can someone help me . This program needs to run in visual studio and written in c++. I want to call to the function string eraseChar in the main function to use the variables str and ch. I cannot use global variables.

#include #include

using namespace std; string eraseChar(char ch = 'e', string str = "the bike fell in the water");

int main() { int pos; pos = str.find(ch); while (pos != string::npos) {

str.erase(pos, 1); pos = str.find(ch); } cout << str << endl; system("pause"); return 0;

}

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!