New to c++

I m new to c++. I have studied C++concepts, DATA file Handling and Data structures in c++.I've been using Turbo c++ andNow i am having problems in switching to Code::Blocks or Microsoft Visual C++. They are not able to run a simple hello world program which ran flawlessly in turbo c++.
1
2
3
4
5
6
7
#include<iostream.h>
#include<conio.h>
void main()
{
   cout<<"hello world";
   getch();
}
#include<iostream.h> →→ #include<iostream>

.h versions of headers are deprecated. Rule of thumb: if standart header have ".h" do not use it. There: ( http://cplusplus.com/reference/ ) you can see C++ headers and corresponding deprecated versions.

#include<conio.h> — Non-standart deprecated library. Do not use it. Modern compilers don't even have it.

To prevent console closing: http://cplusplus.com/articles/iw6AC542/
Code::Blocks + gcc will not close console automaticly after program finish executing, so you don't even need to prevent that.
Last edited on
Topic archived. No new replies allowed.