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

7 Years
Discussion Span
Last Post by jonsca

This one is pretty decent:


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.

Edited by Clinton Portis: n/a


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 
        return 0;    //the return value for the main function

Edited by jonsca: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.