Press Enter to Continue

前端 未结 7 1866
南笙
南笙 2020-12-05 02:08

This doesn\'t work:

string temp;
cout << \"Press Enter to Continue\";
cin >> temp;
相关标签:
7条回答
  • 2020-12-05 02:57

    Try:

    cout << "Press Enter to Continue";
    getchar(); 
    

    On success, the character read is returned (promoted to an int value, int getchar ( void );), which can be used in a test block (while, etc).

    0 讨论(0)
提交回复
热议问题