+ 1

difference between include <iostream> vs <iostream.h>

Hi all, can someone share difference between iostream and Iostream.h. When written in include statement does above make any difference

5th Dec 2016, 5:48 AM
Shekhar Bahuguna
Shekhar Bahuguna - avatar
6 Réponses
+ 4
It may fail to compile due to simple lack of the header. ... iostream.h is deprecated by those compilers that provide it, iostream is part of the C++ standard. To clarify explicitly there is no mention of iostream.h at all in the current C++ standard
5th Dec 2016, 7:53 AM
chandni singh
chandni singh - avatar
+ 4
.h is the extension of header file.. for ansi we are using <iostream> and for turbo <iostream.h> ... its depend upon compiler... bt both are valid
5th Dec 2016, 1:33 PM
Amit
Amit - avatar
+ 3
.h is the extension of header file so we have to use it,without it you can't compile the program
5th Dec 2016, 5:52 AM
Krishna Teja
Krishna Teja - avatar
+ 3
As far as i know, iso c++ 2011 standard template library (STL) header files not using .h extension. In the past many compiler support stl .h extension.
5th Dec 2016, 7:18 AM
Aris Sugiarto
Aris Sugiarto - avatar
+ 2
iostream.h is not a part of the ISO C++ standard, iostream contains std namespace where as iostream. h does not. The only .h headers in C++ are those inherited from C like the stdio.h. The C++ standard library is guaranteed to have 18 standard headers from the C language. These headers come in two standard flavors, <cxxx> and <xxx.h> (where xxx is the basename of the header, such as stdio, stdlib, etc). These two flavors are identical except the <cxxx> versions provide their declarations in the std namespace only, and the <xxx.h> versions make them available both in std namespace and in the global namespace. The committee did it this way so that existing C code could continue to be compiled in C++. However the <xxx.h> versions are deprecated, meaning they are standard now but might not be part of the standard in future revisions.
6th Dec 2016, 8:32 AM
Sourabh Khandelwal
Sourabh Khandelwal - avatar
+ 1
I think we can compile using only #include<iostream> because it's an namespace standard but while using the above statement we have to include using namespace std;
11th Feb 2017, 5:49 PM
Bharath yadav
Bharath yadav - avatar