[A86] Re: C++ Question?


[Prev][Next][Index][Thread]

[A86] Re: C++ Question?




"Tip 1: <iostream.h> or <iostream>?
Many C++ programmers still use <iostream.h> instead of the newer, standard
compliant <iostream> library. What are the differences between the two?
First, the .h notation of standard header files was deprecated more than
five years ago. Using deprecated features in new code is never a good idea.
In terms of functionality, <iostream> contains a set of templatized I/O
classes which support both narrow and wide characters, as opposed to
<iostream.h> which only supports char-oriented streams. Third, the C++
standard specification of iostream's interface was changed in many subtle
aspects. Consequently, the interfaces and implementation of <iostream>
differ from those of <iostream.h>. Finally, <iostream> components are
declared in namespace std whereas <iostream.h> components are global.

Because of these substantial differences, you cannot mix the two libraries
in one program. As a rule, use <iostream> unless you're dealing with legacy
code that is only compatible with <iostream.h>."

http://www.cplus-zone.com/free/articles/toptips/toptips.asp

> What is the difference between these:
>
> #include <iostream>
>
> and
>
> #include <iostream.h>