私のプログラムはループし続け、 "return 0;"を得ることはありません。コンパイラが悪いのかコードですか?私のプログラムはループを維持し、 "return 0;"を得ることはありません。コンパイラが悪いのかコードですか?
#include<iostream>
using namespace std;
int main() {
string nameInput = "";
string Input = "Yes";
cout << "Welcome to the purple casino!" << endl << "What's your name?" << endl;
while(Input =="Yes" || "yes"){
getline(cin, nameInput);
cout << nameInput << ", what a nice name!" << endl << "Do you want to change it?" << endl;
getline(cin, Input);
if(Input =="Yes" || "yes"){
cout << "To what?" << endl;
}
}
cout << "Let's begin!";
return 0;
}
経験則:コンパイラではなく、あなたです! –
うんざりしたくぼみを除いて、これはよく聞かれます。 – Bathsheba
少なくとも99.99%のケースでは、https://stackoverflow.com/questions/42088015/lambda-capture-and-parameter-with-same-name-who-shadows-the-other-clang-vs-gを参照してください。反例のために。 –