I have a problem with this code. My if statement for userInput.find("=") is always true :
std::string userInput;
while (1)
{
std::cout << "> ";
getline(std::cin, userInput);
if (std::cin.eof())
{
std::cout << "Program Exit" << std::endl;
return 0;
}
if (userInput == "exit")
{
std::cout << "Program exit" << std::endl;
return 0;
}
if (userInput.find("="))
{
std::cout << "yes" << std::endl;
}
}
output :
./main
> print a
yes
> exit
> Program Exit
But I don't see any "=" in my "print a" sentence