[c++] fatal error: iostream.h no such file or directory

Possible Duplicate:
No such file iostream.h when including

Even after naming the source file with .cpp extension. my compiler gives this error, both in command prompt and Codeblocks. How can I fix this issue?

#include <iostream.h>


int main(){

    cout<<"Hello World!\n";
    return 0;
}

This question is related to c++ codeblocks

The answer is


You should be using iostream without the .h.

Early implementations used the .h variants but the standard mandates the more modern style.


Using standard C++ calling (note that you should use namespace std for cout or add using namespace std;)

#include <iostream>

int main()
{
    std::cout<<"Hello World!\n";
    return 0;
}