Mail Archives: djgpp/1997/03/03/03:27:51
Anthony Villena (skylight AT arn DOT net) writes:
> Hi!
>
> I'm fairly new with C, and have decided to make DJGPP the compiler
> of my choice. Unfortunatly I haven't found any thing in the docs
> that tell me how to send text to the printer. If you could help it
> would be MUCH apperciated. Thanks!
In regular C:
/* printtst.c
Shows how to send a simple text message to the printer.
Anything you can do with printf can be done on the printer too.
Graphics? That's a topic for another day :-)
*/
#include <stdio.h>
void main (void) { /* For simplicity. Might cause warnings with -Wall */
FILE *printer; /* Pointer to file structure for the printer */
printer=fopen("PRN:","w"); /* Open printer for writing, set up file
structure. */
fprintf (printer,"Hello, World!");
fclose(printer); /* Clean up printer, and ensure last line sent to
it is printed. */
}
In C++:
I haven't a clue, but there might well be a printer stream like the
monitor stream "cout" using libiostr.
Also, there might be a "stdprn" in stdio.h. I can't recall.
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -