* ego, on 04.08.2010 19:38:
ok! when I want to put the message "abc" to the screen I use the
methode cout<<"abc";
but what can I do if want to print that directly to the printer?
Depends on the printer.
But in Windows you can redirect the output to the 'prn' device,
C:\> myprog >prn
and possibly your printer will print something! ;-)
Wait, wait, you may have to use the 'print' command first, to set up 'prn'.
A simple method in Windows is
C:\> myprog >result.txt
C:\> notepad /p result.txt
Disclaimer: this is off my hindbrain, it's at least a decade since I've needed
this so details may not be totally correct.
Similarly, in *nix you have lp* programs you can pipe the output to.
Disclaimer: it's about three decades since I implemented those programs (in C),
a "Mosaic spooling system" as I recall, and never used since then...
Cheers & hth.,
- Alf