Detecting ENTER key in C++

前端 未结 7 744
不知归路
不知归路 2020-12-17 03:07

I have a program like this,

char name[100];
char age[12];
cout << \"Enter Name: \";
cin >> name;

cout << \"Enter Age: \";
cin >> age         


        
7条回答
  •  -上瘾入骨i
    2020-12-17 03:21

    you can include the "conio.h" library and use getch();

    #include 
    #include 
    
    using namespace std;
    
    int main(){
    
    cout << "press enter";
    getch();
    
    return 0;
    
    }
    

提交回复
热议问题