a beginner ask's for help

Hi guys. I decided to try C++ and i bought my book.
It's First program is the hello world program but i have problem's compiling it through dev-c++.

here's the code my book provides :

#include <iostream>
int main()
{ std::cout << "Hello World!\n";
}

Can someone tell me whats wrong with it and which compliler should i take to work
with?

By the way problems occured with the Fifth Version of dev-c++ ( 4.9.9.2 )

Thanks in advice! :) ( and sorry for my bad english )
Can you please give us the error from the compiler?

Edit:
and which compliler should i take to work
with?

Does this mean you have no compiler installed?!
Last edited on
@ Paul Combaldieu

thanks for reply

I use Dev-C++ 5 ( 4.9.9.2 ) Beta

I rewrite my code and the program compiled without errors . But now i have another problem. My program closes immediately after opening.

What should i include to the code to fix it?

thanks in advice.
closed account (NUj6URfi)
Do this:

1
2
3
4
5
6
7
8
9
#include <iostream>
using namespace std;

int main() { 

cout << "Hello World!\n";
cin.get();
return 0;
}


Dev-c++ can be a little picky.
@ toad1359

Thank you ! It worked out.
One last thing. If possible , can you tell me which compiler you recommend for a newbie / beginner like me? :)
closed account (o3hC5Di1)
Hi there,

For beginners (on windows) Code::Blocks is quite popular as a coding program.
It comes with a compiler and debugger integrated, so you don't have to worry about those when yu're just starting out.

All the best,
NwN
@ All
Thanks everyone! I really apriciate your replies.
best of luck to all of you
thanxxxxxxx! :)
The latest version of Dev C++ is 5.4.2
I highly recommend you upgrade.
http://orwelldevcpp.blogspot.com/
closed account (NUj6URfi)
I thought 5.4.2. was a beta.
5.4.2 is the latest release version - last update 25 May 2013 .

There is a newer version 5.4.3 which is a "release candidate", last update 27 September 2013 .
Topic archived. No new replies allowed.