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
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
Get step-by-step solutions from verified subject matter experts
