라인 작동하지 닫으려면 하면서 무한 루프 - 숯불 C++
cin >> cRestart;
는 숯을 캡처되어 있지만 while 루프가 종료되지 않는다. 계속 나아갈 코드가 필요해. 제발 도와 줄 수있어? 는
bool startInputValidation()
{
char cRestart = 'b'; //set initial value at b to run while loop
conRGB(COLOUR_WHITE); //text colour white
conXY(0, 19); //cursor position in console
drawLine(); //draws a horizontal line across screen
conXY(0, 23);
drawLine();
while (cRestart != 'y' || cRestart != 'Y' || cRestart != 'n' || cRestart != 'N') //check for correct input (Y/N)
{
conXY(21, 21);
for(int iCount = 0; iCount < 139; iCount++) //blank lines
{
cout << " ";
}
conXY(21, 21);
cout << "ARE YOU SURE YOU WISH TO CONTINUE Y/N? "; //ask question
cin >> cRestart; //get input from user
}
if (cRestart == 'y' || cRestart == 'Y') //if yes return true
{
return true;
}
else
{
return false;
}
}
다음과 같은 방법을 작성합니다 타트 '는 항상 적어도 한 번에 그 캐릭터의 * 3 *에 불평등합니다. 현재 루프는 적어도 하나 이상은 불투명합니다. – cHao