#include<iostream>
using std::cin;
using std::cout;
using std::numeric_limits;
using std::streamsize;
int main()
{
char c;
while(cin>>c);
cin.clear(); //trying to set cin to good state, right ?
cin.ignore(numeric_limits<streamsize>::max());//how to empty the stream ?
cout<<"To here...\n";
cin>>c;
}
I typed control-d to exit the first while input, but I can not reset the cin
to read input again. Anyone help me, please. Thanks in advance.