Mega Code Archive

 
Categories / C++ / Console
 

Using get() with No Parameters to read single char

#include <iostream> using namespace std; int main() {    char ch;    while ( (ch = cin.get()) != EOF)    {       cout << "ch: " << ch << endl;    }    cout << "\nDone!\n";  return 0; }