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;

Something similar to this?

#include <iostream>
using namespace std;

int main()
{
   cout << "Press [enter] to continue...";
   cin.get();
   cout << "Hello\n";
   return 0;
}

>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.

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.)

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

This question has already been answered. Start a new discussion instead.