I have to get many chars one by one with getchar() function.
I have to clean the buffer after using the function, but flushall() doesn't do it. After the second iteration of the function it gets '\n' as input. I tried using fflush(), _flushall(), but no one succeed doing this. What is the reason for that? please help.
Note: I must use getchar().
int i;
char c;
for (i = 0; i < 5; i++)
{
c = getchar();
printf("%c", c);
_flushall();
}