【发布时间】:2014-02-06 16:57:30
【问题描述】:
我使用 cin.get() 让程序暂停并等待用户输入,它工作正常。我把它放在 if 语句中的那一刻,它只是跳过那个“等待”期并继续代码?我该如何解决这个问题。这是不工作的部分。
do
{
cout << "\n\n\nEnter the number of one of the following and I will explain!\n";
cout << "1.integer 2.boolian 3.floats 4.doubles 5.character";
cout << "\n\n[when you are done type 'done' to continue]\n\n";
cin >> option;
if (option = 1);
{
cout << "\nInteger is the variable abbreviated as 'int' this allows C++ to only";
cout << "\nreadwhole and real numbers \n\n";
cin.get(); //this is the part where it just skips.. it should wait
}
} while (var = 1);
【问题讨论】:
-
正如@0x499602D2 在我的回答中在 cmets 中指出的那样,您还有很多其他问题。确保您阅读了这些 cmets。
标签: c++