C++ char type read from console

Description

C++ char type read from console

#include <iostream>
using namespace std;
int main()//  w w  w.  ja  v  a 2 s.c o  m
{
   char fkey;
   cout << "Type in a character: ";
   cin.get(fkey);
   cout << "The key just accepted is " << int(fkey) << endl;
   return 0;
}



PreviousNext

Related