C++ examples for File Stream:cin
Type in two characters
#include <iostream> using namespace std; int main()/* www. ja va2 s . c o m*/ { char fkey, skey; cout << "Type in a character: "; cin.get(fkey); cout << "The key just accepted is " << int(fkey) << endl; cout << "Type in another character: "; cin.get(skey); cout << "The key just accepted is " << int(skey) << endl; return 0; }