Is <iostream.h>and <iostream>same

Shanpav12

Disciple
Hello,
I dont know how to do, I read sumita Arora C++ Books, D.Ravichandran etc and they all have C++ Programs with <iostream.h> header files whereas when i run Visual studio their sample Programs have <iostream>> header file, So is Iostrem.h is gone and should i not use Iostream.h any more in Programs in C++.
Thanks
 
Standard C++ Include Format
As C++ evolved, different compiler vendors chose different extensions for file names. In addition, various operating systems have different restrictions on file names, in particular on name length. These issues caused source code portability problems. To smooth over these rough edges, the standard uses a format that allows file names longer than the notorious eight characters and eliminates the extension. For example, instead of the old style of including iostream.h, which looks like this:
#include <iostream.h>
you can now write:
#include <iostream>

The libraries that have been inherited from C are still available with the traditional ‘.h’ extension. However, you can also use them with the more modern C++ include style by prepending a “c†before the name. Thus:
#include <stdio.h>
#include <stdlib.h>
become:
#include <cstdio>
#include <cstdlib>
And so on, for all the Standard C headers. This provides a nice distinction to the reader indicating when you’re using C versus C++ libraries.
The effect of the new include format is not identical to the old: using the .h gives you the older, non-template version, and
omitting the .h gives you the new templatized version. You’ll usually have problems if you try to intermix the two forms in asingle program.

Shamelessly copy pasted from Bruce Eckel's Thinking in C++ 2nd Edition Volume 1 (Prentice Hall) page 95-96.
Download link: Planet PDF - Thinking in C++
 
Back
Top