do
{
cout << "Car is coming ... " << "[P]ay or [N]ot?" << endl;
ch=getch();
} while (ch !='q' || ch != 'Q');
为什么上面的代码在下面的代码中不工作?我以各种方式在每个语句周围用括号括住了它,并且编译器每次都会弹出一个错误,直到我按照以下方式重新分组为止。我只是想知道为什么这样做。While While Loop问题
do
{
cout << "Car is coming ... " << "[P]ay or [N]ot?" << endl;
ch=getch();
} while (!(ch=='q' || ch=='Q'));
我使用Visual Studio 2008作为我的编译器; x86架构。
PS:什么游戏是这样的?听起来像疯狂出租车。 :-) – Mehrdad 2011-05-23 23:28:07