home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
progm
/
elem-c.zip
/
PRINT.C
< prev
next >
Wrap
Text File
|
1985-05-18
|
768b
|
35 lines
/* attempt at sending characters to the printer. */
#include "stdio.h"
main()
{
char in_name[15];
FILE *read_file, *out_file, *fopen ();
int c;
printf("enter name of file to be printed : ");
scanf ("%.14s", &in_name);
read_file = fopen (in_name, "r");
if ( read_file == NULL )
printf("couldn't open %s for reading.\n",in_name);
else
{
out_file = fopen ("prn:" , "w");
if (out_file == NULL )
Printf("xcheck printer.\n");
else
{
while ( (c = getc(read_file)) != EOF )
putc (c, out_file);
printf("file has been PRINTED!\n");
}
}
out_file = fclose("prn:");
read_file= fclose(in_name);
}