How to print

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2005
Posts: 19
Reputation: tdizzle342 is an unknown quantity at this point 
Solved Threads: 0
tdizzle342 tdizzle342 is offline Offline
Newbie Poster

How to print

 
0
  #1
Oct 31st, 2005
Can someone help me, I've been trying forever and still can't get it. I need to get my C++ program to print in dos enviroment. I need it to print the words "Hello" when i push something and nothing else.

#include <cstdlib>
#include <iostream>
#include <conio.h>

using namespace std;

int main(int argc, char *argv[])
{

cout<<"hello";
Return_0;
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,433
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 249
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: How to print

 
0
  #2
Oct 31st, 2005
Something similar to this?
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. cout << "Press [enter] to continue...";
  7. cin.get();
  8. cout << "Hello\n";
  9. return 0;
  10. }
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 19
Reputation: tdizzle342 is an unknown quantity at this point 
Solved Threads: 0
tdizzle342 tdizzle342 is offline Offline
Newbie Poster

Re: How to print

 
0
  #3
Nov 1st, 2005
Ya but how do i get it to print hello on paper.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,804
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: 747
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: How to print

 
0
  #4
Nov 1st, 2005
>Ya but how do i get it to print hello on paper.
Start by being more specific about your compiler and OS. To do it "right" is a lot of work, but most of the time you can do it pretty easily with a compiler/system-specific solution.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 108
Reputation: prog-bman is an unknown quantity at this point 
Solved Threads: 3
prog-bman prog-bman is offline Offline
Junior Poster

Re: How to print

 
0
  #5
Nov 1st, 2005
Narue,
What are you talking about professors know everything.......
Join me on IRC:
Server: irc.daniweb.com
Channel: #C++

Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,109
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 943
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: How to print

 
0
  #6
Nov 1st, 2005
If you have Windows and Dev-C++ then you are in luck. Look at the code snippet:
http://www.daniweb.com/code/snippet122.html
This might be a little overkill since it allows you to set the font, wordwrap and more. Trim it back to what you need!
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 494
Reputation: Puckdropper is an unknown quantity at this point 
Solved Threads: 21
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: How to print

 
0
  #7
Nov 2nd, 2005
In DOS, I'd consider issuing:
ctty lpt1

(Warning! This may be written incorrectly. It's been a while.)

Then, everything would print out at the printer connected to the parallel port. (Great for a paper log of a process.)
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 19
Reputation: tdizzle342 is an unknown quantity at this point 
Solved Threads: 0
tdizzle342 tdizzle342 is offline Offline
Newbie Poster

Re: How to print

 
0
  #8
Nov 6th, 2005
Thanks guys , and thanks for that huge ass code on how to print, im still new at c++ and that code didnt really help too too much but i really appreaciate it guys. Thanks
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
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC