I am trying to write a C++ program in which when user enter any character from keyboard and it should move to next line of code.
Here is my code:
char c;
cin>>c;
cout<<"Something"<<endl;
but this is not working, because it only move to next line when I input some character and then press ENTER.
OR
If I use this
cin.get() or cin.get(c)
it move to next line of instruction when I press Enter.
But I wanted it to move to next line on any key pressed on the keyboard, how this can be done?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…