Hi I am a little new to programming and am a little frustrated. I am trying to figure out how to edit a character string that has been assigned a variable name. For example:
line = Sam, I am.
I think I have to use something like the code below, but I want to use the variable line or find a way to get the string into the function with quotes.
string str("Sam, I am.");
cout << str << endl;
str.erase(remove_if(str.begin(),str.end(),ispunct) ,str.end());
cout << str << endl;
return 0;
Is there a way to pass the string this way?