Advertisement
obernardovieira

Basic getchar without use enter

Jun 1st, 2013
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <conio.h>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     char key = ' ';
  8.     cout << "Enter a key" << endl;
  9.     key = _getch();
  10.     cout << "You entered: " << key << endl;
  11.     system("pause");
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement