When including a header file in C++, what's the difference between...
1) including the .h versus not including the .h when wrapping it in < > signs?
#include <iostream> vs. #include <iostream.h>
2) wrapping the header name in double quotes versus wrapping it in < > signs?
#include <iostream.h> vs. #include "iostream.h"
Thanks in advance!
The simple answer to the first answer is that iostream.h doesn't exist, at least in the GCC implementation. If you're on *nix, type
% locate iostream.h
/usr/include/c++/3.4.3/backward/iostream.h
and
% locate iostream
/usr/include/c++/3.4.3/iostream
/usr/include/c++/3.4.3/backward/iostream.h
As Zee's article says, iostream.h is for backward compatibility.
In short:
iostream.h is deprecated - it is the original Stroustrup version, and iostream is the version from the standards committee. Generally compilers point them both to the same thing, but some older compilers won't have the older one. In some odd cases they will both exist and be different (to support legacy code) and you then must be specific.
"" versus <> simply means check the local directories for the header before going to the library (in most compilers).
-Adam