Flush a stream: how to use fflush : Console Output « Console « C / ANSI-C






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

1.Check how many char have been outputed from printfCheck how many char have been outputed from printf