Greetings EveryOne
About Flush the input buffer in FAQ:
is this where the input buffer get cleared?Code:#include <stdio.h> int main(void) { int ch; char buf[BUFSIZ]; puts("Flushing input"); while ((ch = getchar()) != '\n' && ch != EOF); printf ("Enter some text: "); if (fgets(buf, sizeof(buf), stdin)) { printf ("You entered: %s", buf); } return 0; }
Thank You In AdvanceCode:while ((ch = getchar()) != '\n' && ch != EOF);