sample code‎ > ‎

_getch

#include <conio.h>
#include <iostream>

int main(void)
{
  char c;
  do {
    c = _getch();
    std::cout << c << std::endl;
  } while(c != 'q');

  return 0;
}