Flush a stream: how to use fflush
#include <stdio.h>
int main()
{
char string[80];
printf( "Enter a string: " );
scanf( "%s", string );
printf( "The string you entered is : %s\n", string );
fflush ( stdin );
return 0;
}
Related examples in the same category