Mail Archives: djgpp/1997/02/20/05:27:47
Gautam N. Lad wrote:
>
> Hi,
> Can someone tell me how to print using fprintf()?
> Basically, I want to print to LPT1. I know this is possible!
ANSI C defines an output file called 'stdprn' which is always open and
allows you to write to the printer. So, you'd just use something like
the following:
fprintf( stdprn, "This is going to the printer.\n" );
If you have a line or dot-matrix printer, then you'll see the line of
text immediately as you send it (or rather, as soon as you send a
newline). If you have a laser, bubblejet, or inkjet printer, it buffers
the data until it gets a full page, so you'll need to send a form feed
('\f') in order to get a printout.
Hope this helps!
--
John M. Aldrich <fighteer AT cs DOT com>
* Anything that happens, happens.
* Anything that, in happening, causes something else to happen,
causes something else to happen.
* Anything that, in happening, causes itself to happen again, happens
again.
* It doesn't necessarily do it in chronological order, though.
--- Douglas Adams
- Raw text -