error C2677: binary '||' : no global operator found which takes type 'std::string' (or there is no acceptable conversion)
when i get this error what am i facing?
error C2677: binary '||' : no global operator found which takes type 'std::string' (or there is no acceptable conversion)
when i get this error what am i facing?
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
OK the error was gone when i used two equal signs cuz i forgot that what am doing is something similar to strcmp...Code:bool Vehicle:: Any_Accident(void){ string accident; cout<<"\nHas The Vehicle Been through any accidents?"<<"\nYes/No:"; cin>> accident; if (accident== "yes" || accident== "Yes"){ return 1; } else return 0; }
Why is there braces around the return in the if-side, but not braces in the else-side?Code:if (accident== "yes" || accident== "Yes"){ return 1; } else return 0;
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
"No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
"Have you tried turning it off and on again?" - The IT Crowd