C++ Problems

Starting to learn c++ again and im having some real problems getting started. im typing the simple program.
#include <iostream.h>
int main()
{
cout <<"hello world";
return 0;
}
And here is the list of errors from this:
#include <iostream.h>
(iostream.h no file)
(cout undeclared)
and several others.
im running code blocks with the default compiler. And visual is up to date.

Please help,
jolejake
The program would have been valid before 1998. Since then there's been a new iostream librar that is in the std namespace, and the head file has changed to iostream (without the .h).

So that program ported to the current standard is:
1
2
3
4
5
6
7
#include <iostream>

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

begin this way:
1
2
#include<iostream>
using namespace std;


so you dont have to write each some thing like std::cout but instead, cout

Enjoy learing C++
you can also try the following

1
2
3
4
5
6
7
#include<iostream.h>

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


youhave to use cout<< instead of std::cout when using #include<iostream.h>
There is no such thing as iostream.h, even the compiler said:
#include <iostream.h>
(iostream.h no file)
Topic archived. No new replies allowed.