Greetings,
I've been studying programming from time to time and decided to make a text adventure, to practice what I already know. However, I have bumped into a problem with analysing a string that is determined by user input:
1 2
|
for( pos = i.begin(); pos != i.end() || pos != i.find( " " ); ++pos){
iCheck += *pos;
|
This was supposed to look trough the string and put the first word into a seperate string:
The loop ends when the string is only one word long
pos != i.end()
or is supposed to end when it encounter a space in the string
|| pos != i.find( " " )
However, when trying to run my program I get the following error:
error: no match for 'operator!=' in 'pos != (&i)->std::basic_string<_CharT, _Traits, _Alloc>::find [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((const char*)" "), 0u)'