web analytics

<iostream.h> or <iostream>

Options

davegate 143 - 921
@2016-01-07 15:19:12

The <iostream.h> library has been deprecated from the C++ standard specification, so it is recommended that you should use the standard-compliant <iostream> library instead of the older <iostream.h> library whenever you can.

There are some key differences between the these two librares:

First, the .h notation of standard header files was deprecated. Using deprecated features in new code is never a good idea.

Second, <iostream> contains a set of templatized I/O classes which support both narrow and wide characters. By contrast, <iostream.h> classes are confined to char exclusively.

Third, the C++ standard specification of iostream's interface was changed in many subtle aspects. Consequently, the interfaces and implementation of <iostream> differ from <iostream.h>.

Finally, <iostream> components are declared in namespace std whereas <iostream.h> components are declared in the global scope. Because of these substantial differences, you cannot mix the two libraries in one program.

As a rule, use <iostream> in new code and stick to <iostream.h> in legacy code that is incompatible with the new <iostream> library. 

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com