954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How do I print in terminal?

For some reason, I can't even get a simple "Hello World" to print out in terminal. I'm using Borland C++ Builder 6. The Form1 window comes up but nothing is written in it. No errors, just a blank page.

rcaldera43
Newbie Poster
5 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

Code?

twomers
Posting Virtuoso
1,877 posts since May 2007
Reputation Points: 453
Solved Threads: 57
 

Oh yeah, I guess the code would help:

#include // I/O
using namespace std;
#include // file I/O
#include // format manipulation

int main()
{
cout << "Hello World!\n";
return 0;
}

rcaldera43
Newbie Poster
5 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

You're probably using an old compiler. Might do good to update it.
Try putting a cin.get() and cin.ignore() before the return 0 in main(). Does the console window disappear, or does nothing turn up?

twomers
Posting Virtuoso
1,877 posts since May 2007
Reputation Points: 453
Solved Threads: 57
 

I added the cin arguments you mentioned and still nothing. When I say, 'nothing', no error comes up, just the 'Form1' box comes up with nothing in it. I know it must be something basic that I'm missing. I just want to see the output of my basic program just to know the program's working. I'm using Windows7 and Borland C++ with the latest updates. If it would be easier to help me, I've also got Visual Studio 2008 installed too.

rcaldera43
Newbie Poster
5 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 
I added the cin arguments you mentioned and still nothing. When I say, 'nothing', no error comes up, just the 'Form1' box comes up with nothing in it. I know it must be something basic that I'm missing. I just want to see the output of my basic program just to know the program's working. I'm using Windows7 and Borland C++ with the latest updates. If it would be easier to help me, I've also got Visual Studio 2008 installed too.


Try it with VS '08 so. Same code. Though get rid of the .h from the include files.

twomers
Posting Virtuoso
1,877 posts since May 2007
Reputation Points: 453
Solved Threads: 57
 

Man, this is frustrating. I remember in school, years ago, running this simple of a program was 1,2,3 because Borland and VS were simpler. Once again, even in VS, nothing happens. I just want to see a simple "Hello World" on my computer. What is the most simplest easy way to accomplish this? I feel that my OS and compilers have come too far for me.

rcaldera43
Newbie Poster
5 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

try geting this program to compile / make your codes it is really easy http://www.bloodshed.net/dev/devcpp.html

ImMoRtAl-
Newbie Poster
20 posts since Sep 2009
Reputation Points: 10
Solved Threads: 1
 

I finally got it to work. I put a pause near the end so now the terminal stays on. It was disappearing so fast that I never saw it. Thanks for all your help mate!

rcaldera43
Newbie Poster
5 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

As I said in post #4 :rolleyes:

twomers
Posting Virtuoso
1,877 posts since May 2007
Reputation Points: 453
Solved Threads: 57
 

The best place to go to make custom, quality, most cost-efficient, business cards
out of your photos is www.PrintsMadeEasy.com. They specialize in designing custom postcards,
business cards, stationery, labels, brochures, invitations, envelopes, flyers,
greeting cards, letterhead, pens, & labels

http://www.PrintsMadeEasy.com

Right now you can get 100 FREE business cards shipped right to your door.

All orders ship worldwide within 24 hours once you submit the custom design you want!

You may also want to check out http://www.Postcards.com <--- same deal, custom printing, any size, high-gloss, excellent quality and service

tomdupuy
Newbie Poster
1 post since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You