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.
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?
and on Mac and Linux:
will output "Press any key to continue..." and obviously, wait for any key to be pressed. I hope thats what you meant