Hey!
I've got a program that... well, check out the code below (what I currently have):
As you can see, I have an if loop that I want to check to see the first three characters of a string with to see if they match what I had put in.Code:if(userInput.substr(0, 3) == 'cd ' || 'Cd ' || 'cD ' || 'CD ') { nDirLoc = userInput.substr(3, 255); }
GCC complains:
How can I go about checking to see whether or not the substring results are that of what I am expecting?no match for 'operator==' in 'std::basic_string<_CharT, _Traits, _Alloc>::substr(typename _Alloc::size_type, typename _Alloc::size_type) const [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](0u, 3u) == 6513696'
Thanks for the help!
FlyingIsFun1217