home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / elem-c.zip / PRINT.C < prev    next >
Text File  |  1985-05-18  |  768b  |  35 lines

  1. /*        attempt at sending characters to the printer.    */
  2. #include "stdio.h"
  3.  
  4. main()
  5.     {
  6.         char in_name[15];
  7.         FILE *read_file, *out_file, *fopen ();
  8.         int c;
  9.  
  10.         printf("enter name of file to be printed : ");
  11.         scanf ("%.14s", &in_name);
  12.         read_file = fopen (in_name, "r");
  13.  
  14.         if ( read_file == NULL )
  15.             printf("couldn't open %s for reading.\n",in_name);
  16.         else
  17.             {
  18.                 out_file = fopen ("prn:" , "w");
  19.                     if (out_file == NULL )
  20.                         Printf("xcheck printer.\n");
  21.                     else
  22.                     {
  23.                         while ( (c = getc(read_file)) != EOF )
  24.                             putc (c, out_file);
  25.  
  26.                         printf("file has been PRINTED!\n");
  27.  
  28.                         }
  29.                 }
  30.                     out_file = fclose("prn:");
  31.                     read_file= fclose(in_name);
  32.  
  33.     }
  34.