# iostream.h in VC++ 2005 Beta

## Recommended Posts

Does anyone know why there is no iostream header in VC++ 2005 beta, i couldn't find it in 2003 either, is there a way to put it there (when i took it from VS6 i got an error when iostream tried to import another header). Any help would be appreciated

##### Share on other sites
Ir's simply <iostream>, not <iostream.h>. If the header (e.g. the actual file) isn't in your includes directory, you might want to consider re-installing VS.Net.

##### Share on other sites
as hinted at above, iostream.h is pre-standard and as such nowt in it exists in a namespace.
iostream is the standard complient version, where everything exists in namespace std.
Looks like MS have gone a little further with strict standard compliance this time, which is intrest and could break a fair bit of people code (and online tutorials...)

##### Share on other sites
when i try just <iostream>with:

cout << "Hello, World!" << endl;

i get the following errors

error C2065: 'cout' : undeclared identifier
error C2065: 'endl' : undeclared identifier

any ideas on what might be causing this?

##### Share on other sites

using namespace std;

or use

std::cout
std::endl

##### Share on other sites
#include <iostream>using namespace std;int main(){   cout << "Hello world" << endl;   return 0;}

You need to signify which namespace is being used, otherwise it has no idea where cout and such come from.

##### Share on other sites
Thanks Arek the Absolute, that fixed my problem.

##### Share on other sites
If you are trying out examples from some book, that book is pretty outdated. Scrap it and get another one!

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627638
• Total Posts
2978327

• 10
• 12
• 22
• 13
• 34