string Foo(string letter)
{
for (int j = 0; j < (int)alphabet.length(); j++)
{
if (letter[0] == (alphabet[j]));
return "SUCCESS";
}
return "FAILURE";
}
alphabet = "Test";
cout << Foo("f") << endl;
这会打印 SUCCESS 甚至认为它不应该。我的比较运算符有什么问题?