| | |
c++ print on paper
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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
>does anyone know if there is a code in c++ that allows print on paper instead of monitor?
Communicating with specific hardware is outside the bounds of standard C++. If you want a good answer, you need to tell us what compiler you're using and your operating system.
Communicating with specific hardware is outside the bounds of standard C++. If you want a good answer, you need to tell us what compiler you're using and your operating system.
New members chased away this month: 5
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.
Views: 1588 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






