// textin2.cpp -- using cin.get(char) #include int main() { using namespace std; char ch; int count = 0; cout << "Enter characters; enter # to quit:\n"; cin.get(ch); // use the cin.get(ch) function while (ch != '#') { cout << ch; ++count; cin.get(ch); // use it again } cout << endl << count << " characters read\n"; // get rid of rest of line // while (cin.get() != '\n') // ; //cin.get(); return 0; }