using namespace std error

Started by
9 comments, last by Graham 20 years, 1 month ago
quote:Original post by Graham
Thanks for the help. The problem was that I was that my include statement was, #include <iostream.h>, instead of #include <iostream> If you put the .h then you dont need std, but without the .h you do.


Those are pre-standard headers and have never been ''deprecated'' as cilcoder puts it. There is a difference as well with the fact that the libraries are actually different. The pre-standard iostream library didn''t work with iterators. The standard one (defined within namespace std) does.

Many books from pre 1997 use pre-standard headers in their examples. If you have a post 1997/98 book which doesn''t use standard headers I''d throw it away and get a better one.

This topic is closed to new replies.

Advertisement