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を出力します。比較演算子の何が問題になっていますか?