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
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;
}
Source: Stackoverflow.com