How to read until ESC button is pressed from cin in C++

前端 未结 5 1238
予麋鹿
予麋鹿 2020-12-10 19:17

I\'m coding a program that reads data directly from user input and was wondering how could I read all data until ESC button on keyboard is pressed. I found only something li

5条回答
  •  一个人的身影
    2020-12-10 20:00

    #include 
    #include 
    
    using namespace std;
    
    int main()
    {
        int number;
        char ch;
    
        bool loop=false;
        while(loop==false)
        {  cin>>number;
           cout<

提交回复
热议问题