iostream and namespace

Jul 25, 2010 at 9:07am
Hi!
what is the difference between using <iostream.h> and
1
2
<iostream>  
using namespace std;

Can you tell me where should i use the first one when the second one?
I'm using VC.6
Thanks!
Last edited on Jul 25, 2010 at 9:08am
Jul 25, 2010 at 9:41am
The first one is VERY old, the second one is the standard.
VC 6 is old, see http://www.cplusplus.com/forum/articles/7263/
Jul 25, 2010 at 10:06am
Download VisualStudio 2010 Express. It's pretty good.

Though I prefer Eclipse with g++.

Also, about the namespace, That has nothing to do with the header, iostream. It is a directing to use functions from the Std namespace, like cout, endl, cin, etc. Beware that this can cause conflicts with other namespaces that have things named the same as things from other namespaces... the safer way is to do something like std::cout << std::endl; calling things directly.

Also note that you will never see a namespace in C, since it is not OO.
Last edited on Jul 25, 2010 at 10:06am
Topic archived. No new replies allowed.