0
Hello, I’m trying to use a
remove_if
in c++ but when it gets to the input part I can’t determine for it to detect if the string I’m pointing has a char. Follows my code:
temp.erase(remove_if(temp.begin(), temp.end(), "("), temp.end());
temp is a string. wanted it to detect "(" but I’m not even able to compile that way. I saw some people saying that it is necessary to create a function for this, but I do not know how I should return such a function. Someone could help?
I can do that for more than one char?
– Patrick Machado
You want to compare with more than one
char
inisParenthesis
? You can use the||
thusreturn c == '(' || c == ')';
– kakamg0