Martin Ambuhl said:
Sure, it can. If the printer is accessible as something with which a
FILE * can be associated, fopen(), fprintf(), and fclose() work just
fine. This case obtains in Windows (and DOS), Unix, and most other
systems.
Okay, but there's no standard way to do it. IMHO, this is no different
from accessing networks, serial ports, arbitrary locations on the
screen, or "raw" keyboard input, all of which are also possible in
standard C if the device is accessible through an associated FILE *
object.
<off-topic>
On Unix at least, accessing a locally attached printer through something
which can be fopen'ed often requires special privileges, but there's a
different way to print which is also available to programs which run
without without special privileges. So using fopen to print on Unix
might at least not be the best advice for that platform.
Your advise is usually very good, but I think you overreached this time
in the "please post elsewhere" response.
I still don't think so, but given the other replies to the OP, I concede
(with apologies to the OP) that I'm probably wrong.
Martin