home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_10
/
8n10088c
< prev
next >
Wrap
Text File
|
1990-07-22
|
666b
|
26 lines
******
Listing 6
/* Write to printer, file, or nowhere using stdprn */
if (where_to_go == GO_TO_PRINTER)
file_printer = stdprn;
else if (where_to_go == GO_TO_DISK_FILE)
file_printer = fopen(filename, "w");
else
/* Dump to a Nul file */
file_printer = fopen(NULL_DEVICE,"w");
/* print the line */
fprintf (file_printer, "The answer is %10d", z);
/* close the printer, if it is not the real printer */
if (where_to_go != GO_TO_PRINTER)
fclose (file_printer);
}
*******