fflush(stdin);
Basically wut does fflush do? I dont quite understand it. I read a few books about it but still doesnt quite understand how and the purpose of fflush(stdin).
There is NEVER an appropriate use fflush(stdin) -- fflush is used to force the operating system to write buffered information to the hard drive (or other mass storage device), stdin is a file handle used for keyboard
input or sometimes redirected data file input, so fflush(stdin) has undefined behavior.
If you don't know what a function does then avoid using it until you read and understand its behaviors.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,957 posts
since Aug 2005