c++ print on paper

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Mar 2008
Posts: 31
Reputation: scream2ice is an unknown quantity at this point 
Solved Threads: 0
scream2ice scream2ice is offline Offline
Light Poster

c++ print on paper

 
0
  #1
Jun 25th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 280
Reputation: joshmo is an unknown quantity at this point 
Solved Threads: 19
joshmo joshmo is offline Offline
Posting Whiz in Training

Re: c++ print on paper

 
1
  #2
Jun 25th, 2008
Originally Posted by scream2ice View Post
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
Perhaps output to a file then printing the file
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,858
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 755
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: c++ print on paper

 
2
  #3
Jun 25th, 2008
>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.
New members chased away this month: 5
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 31
Reputation: scream2ice is an unknown quantity at this point 
Solved Threads: 0
scream2ice scream2ice is offline Offline
Light Poster

Re: c++ print on paper

 
0
  #4
Jun 25th, 2008
i use Microsoft Visual C++ 6.0
and my operating system is Windows XP
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 514
Reputation: Jishnu will become famous soon enough Jishnu will become famous soon enough 
Solved Threads: 26
Jishnu's Avatar
Jishnu Jishnu is offline Offline
Posting Pro

Re: c++ print on paper

 
1
  #5
Jun 25th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,953
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: c++ print on paper

 
2
  #6
Jun 25th, 2008
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:
  1. #include <fstream>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. ofstream printer( "prn" );
  8.  
  9. if (!printer)
  10. {
  11. cout << "fooey!\n";
  12. return 1;
  13. }
  14.  
  15. printer << "Hello world!\n";
  16.  
  17. printer.close();
  18. return 0;
  19. }
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!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum


Views: 1588 | Replies: 5
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC