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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any ideas how i can make this script work

Status
Not open for further replies.

Perad

Technical User
Feb 25, 2005
2
GB
Now i know the answer will probably be painfully simple but i can't see it. I also appoligise to any people offended by the noobieness of this question.

I am starting out in C++ and am trying to learn it, but for some reason i am having problems with this...

#include <iostream.h>

void main()
{
cout << "hello world";
}

Yes laugh all you want. But can someone please inform me why when i try to compile and/or run this file it generates 29 errors. What am i doing wrong?

Once again i appoligise for the question but it has been bugging me for literally months. (Gave up on this problem about 4 months ago)

I haven't tried anything else, so i don't know if this is an isolated problem or not
 
What are the errors?


James P. Cottingham
-----------------------------------------
To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.
 
Perad, there's probably something wrong with your compiler or libraries, as this code is fine (except void main(), yet that should not generate errors). Post error messages and information on compiler you're using.
 
try this

#include <iostream.h>

int main()
{
cout << "hello world";
return 0;
}

the code you posted should work also unless there is something wrong with your compiler or the iostream.h header.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top