My string is !!(!())
. I want to remove double exclamation from the string.
This works but it removes all exclamations
remove_copy(str.begin(), str.end(),ostream_iterator<char>(cout), '!');//gives (())
This does not work
remove_copy(str.begin(), str.end(),ostream_iterator<string>(cout), "!!");
Using the above line throws this error
/usr/include/c++/5/bits/predefined_ops.h:194:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] { return *__it == _M_value; }