Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello World! 2

Status
Not open for further replies.

progex

Programmer
Mar 4, 2005
1
EE
So, Hello World and good people!
Im trying to learn C++. But im allready in trouble, or not?
My first program does not work. It is so called "Hello World!" program, and when i run this program, its only flashes one time, and i dont see any result: "Hello World!"
My source code is on my webpage where i write about my learning achievements. Im grateful, when you help me!

Thank You all.
 
After the #include <iostream> which is missing, presumably because the angle brackets haven't been escaped, add
Code:
using namespace std;
 
Also, change your cout to
Code:
cout << "Hello World" << endl;
and remove the system pause.

endl causes a newline and a flush. Your output may be sitting in the buffer but the system pause may be blocking it.

If your #include is iostream.h, you've got the program from a very old source. Change it to iostream
 
This isn't really a newbie forum, you can also try cprogramming.com or cpp-home.com or one of many others. This is a common question that gets answered in FAQs a lot.

Using system("pause"); works, but it isn't necessarily the best way to do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top