<iostream> vs. <iostream.h> vs. "iostream.h"

c++, iostream

Solution

In short:

`iostream.h` is deprecated—it is the original Stroustrup version. `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).

Problem

When including a header file in C++, what's the difference between... including the .h part versus not including .h part when wrapping it in <> signs? #include <iostream> vs. #include <iostream.h> wrapping the header name in double quotes versus wrapping it in < > signs? #include <iostream.h> vs. #include "iostream.h"

Original source

Related problems