Sign in to follow this  
ender_341

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Guest Anonymous Poster
If you are trying out examples from some book, that book is pretty outdated. Scrap it and get another one!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this