qc.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
RDFILE.C
                                             Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
/* RDFILE.C: Reads a file and prints characters to the screen. */
#include <stdio.h>
 
main()
{
   int c;
   FILE *fp;
 
   if( fp = fopen( "c:\\testfile.asc", "rb" ) )
   {
      while( (c = fgetc( fp )) != EOF )
         printf( " %c\t%d\n", c, c );
      printf( "\nEnd of file marker: %d", c );
      fclose( fp );
   }
   else
      printf( "Error in opening file\n" );
}