On Wed, Feb 3, 2010 at 8:07 AM, shadyabhi <[email protected]> wrote: > fflush() is only used for flushing OUTPUT buffer.
http://c-faq.com/stdio/stdinflush2.html > But how do I flush input buffer? > > One way is using:- > > while ((ch = getchar()) != '\n' && ch != EOF); http://c-faq.com/stdio/stdinflush2.html > IS there any OTHER WAY? Depends on your compiler, but there's no Standard[tm] way that will work with every compiler apart from the things mentioned at the links above. -- PJH http://shabbleland.myminicity.com/ind http://www.chavgangs.com/register.php?referer=9375
