/* File: buffer3.c
   Demonstrates the effects of fflush()
*/

#include <stdio.h>

main() {
   int *ptr ;
   FILE *ofile ;

   ofile = fopen("output", "w") ;
   fprintf(ofile, "Hello World\n") ;
   fprintf(ofile, "Hello again") ;
   
   /* flush the buffer */
   fflush(ofile) ;

   /* Crash Burn Die */
   ptr = NULL ;
   *ptr = 123 ;

   fclose(ofile) ;
}
