To All Daniweb users,

I have just started the programming trail of learning, i recently got courses from E learning center on how to use C++.
The first Code (the hello world project) is where I'm having a problem. On Visual Basic 2010 Beta2 which is the only one that even lets me compile my code, I run into an error.

#include <iostream.h>

void main()
{
cout << "Hello World!\n";
}

Is the code. First off the course says i can just go in and create a new source file with notepad and the get a compiler offline and compile then link it. Here's the problem, there is no compiler that works for me other than VBC++ 2010Beat2. This is annoying because i have to create a new project and the compiler isn't all that great. Then I found out why I was having some problems the "cout" command alone doesn't work with VBC++2010Beta2 so here is my questiom. btw: I run windows 7, and DevC++ doesnt work.
How can I get a compiler that will allow me to learn the code the way my course teaches me?

Please Respond Soon

This one is pretty decent:

http://www.codeblocks.org/

Not as easy as it used to be.. you could easily start a 'project' as opposed to a 'c++ source' which will mess things up. The debugger is kinda wack. Also, it forces you to save work you haven't even created yet.

If you can get past all that, it's a pretty decent IDE.

Welcome to the site. There are a number of inconsistencies that your compiler is trying to tell you about, this does not mean that your compiler is bad or faulty.

#include <iostream>    //iostream.h is an outdated header from     
                                     //prestandard days -- if your learning material
                                     //uses it it's probably outdated
using std::cout;       //or using namespace std; but that's a bad habit to 
                                   //get into
int main()  //main should always return an int
{
        cout <<"Hello world\n";   //or std::cout<<"Hello world\n";
                                                 //if you don't use the using statement 
                                                  //above
        return 0;    //the return value for the main function
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.