I get this error
comparison between pointer and integer ('int' and 'const char *')
For the following code
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main()
{
std::string s("test string");
for(auto i = s.begin(); i != s.end(); ++i)
{
cout << ((*i) != "s") << endl;
}
}
Why does dereferencing the string iterator yield an int
and not std::string
?