How to stop reading input...
In my program, i have a timer after which a few inputs. Now the problem is that when the timer function is in process, whatever i type goes as my input. I want to avoid that.
I tried fflush( stdin ); but it didn't work.
So i just created an array and used
for( i=0; ; i++ )
h[i] = getchar();
now i can give a condition h[i]!=EOF or something, but the thing is for tht i need to tell the user to input EOF which i don't want to...
All i need to do is block the input, call the timer function, and resume the input back.. If blocking is not possible is there a way by which i can stop taking an input? The loop above goes on till the buffer gets cleared and then waits for the next input and continues till i give EOF (if i put that as the condition).. i can't have a counter controlled loop because i dunno how much the user enters... i can't have sentinel controlled because the user need not enter the value..
is there a way?