while i can flush stdout using fflush(stdout);, i cant do the same thing with stdin, this was creating a major headache for me, and i came across a site which gave a code snippet to clear the buffer
int ch;
while( (ch = fgetc(fp)) != EOF && ch != '\n' )
/* null body */;
Blogged with Flock
No comments:
Post a Comment