| | |
c++ print on paper
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2007
Posts: 280
Reputation:
Solved Threads: 19
•
•
•
•
hi,
does anyone know if there is a code in c++ that allows print on paper instead of monitor?
i mean instread of using 'cout<<' to see what you want on monitor, use a code to print your info on paper.......cheers
This may be relevant.
"You know you're a computer geek when you try to shoo a fly away from the monitor screen with your cursor. That just happened to me. It was scary." - Juuso Heimonen.
"The only truly secure computer is one buried in concrete, with the power turned off and the network cable cut." - Anonymous.
"The only truly secure computer is one buried in concrete, with the power turned off and the network cable cut." - Anonymous.
If all you want is teletype output (like you get on the console, without any fancy graphics or fonts or etc) you can open the PRN or LPT1 device:
Most PC printers that I know of can handle simple TTY output of this kind. If you open in binary mode you can also send printer control codes (specific to your printer) to program it.
Have fun!
C++ Syntax (Toggle Plain Text)
#include <fstream> #include <iostream> using namespace std; int main() { ofstream printer( "prn" ); if (!printer) { cout << "fooey!\n"; return 1; } printer << "Hello world!\n"; printer.close(); return 0; }
Have fun!
![]() |
Similar Threads
- Paper won't feed through printer (USB Devices and other Peripherals)
- How do I print forms with more than the default size of a form ? (Visual Basic 4 / 5 / 6)
- How to print (C++)
- Desperate to make a decision on a printer (OS X)
- printer's 'no paper in paper tray' problem (Troubleshooting Dead Machines)
- Problem printing from IE6 (Web Browsers)
- Printer wont print (USB Devices and other Peripherals)
- More Printer Problems (USB Devices and other Peripherals)
Other Threads in the C++ Forum
- Previous Thread: print as a chart
- Next Thread: edited. trying to get numbers from a file and calculate taxbracket.
| Thread Tools | Search this Thread |
add api array arrays based beginner binary bmp c++ c/c++ calculator char class classes code compile compiler console conversion count data delete deploy desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib library linkedlist linker linux list loop looping loops map math matrix memory microsoft newbie news number output pointer problem program programming project python random read recursion recursive return simple string strings struct studio temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






