C - C++ Streams - Buffer iterator #include #include #include using namespace std; int main () { string name; istreambuf_iterator eos; istreambuf_iterator iit (cin.rdbuf()); while (iit!=eos && *iit!='\n') name+=*iit++; cout << "Entered string is " << name << ".\n"; return 0; }