#include<iostream>
int main()
{
int x, y;
cin >> x ;
cin >> y ; // This gets ignored
}
Hi in above prog after pressing Ctrl-D during first cin second cin gets ignored. how i can make second cin work after pressing ctr-D during first cin. cin.ignore() and cin.clear() doesn;t seem to work.
My question is that if im pressing ctrl-D during first cin bascially i am leaving eof char in i/p stream which is not going to be read and it reamins there. now can't i remove this character from the stream so that it's ready again for input. if not what's the exact reason behind it.