int ch;
while ((ch = getchar()) != '\n' && ch != EOF);
put int ch in with your variables, and the line starting with "while" where you want to clean up your input buffer. Calling this after...
Type: Posts; User: matsp
int ch;
while ((ch = getchar()) != '\n' && ch != EOF);
put int ch in with your variables, and the line starting with "while" where you want to clean up your input buffer. Calling this after...
That is the wrong solution - flushall is a function that isn't guaranteed to do anything useful or meaningfull for input channels. _DO_ look up the FAQ link that was posted a few posts back. It...