Article View: comp.std.c++
Article #2153Re: STL <iostream> vs. <iostream.h>
From: Steve Clamage
Date: Mon, 09 Oct 1995 21:39
Date: Mon, 09 Oct 1995 21:39
42 lines
1861 bytes
1861 bytes
In article mf8@rational.rational.com, "J\ir\tme Desquilbet" <jDesquilbet@Rational.COM> writes:
>
>Reading the STL part of the CD, I understand that the sample "Hello world"
>program becomes:
>
>#include <iostream>
>int main()
>{
> using namespace std;
> cout << "Hello, world!" << endl;
>}
That is one way to write it. There are other ways as well. You could put
the "using namespace" at file scope, or just have using-declarations
for the items you need from <iostream>.
>If yes, what about "old" programs written using <iostream.h>? What does the
>above program become if I want to write it without using namespace std?
The ".h" versions of the standard C++ headers are not mentioned in the standard.
Implementors may supply as many other headers as they like, with any sort of
contents. I would expect a vendor to supply a header corresponding to the
use of <iostream.h> which looked something like this:
#include <iostream>
using std::ios;
using std::istream;
using std::ostream;
using std::cout;
using std::cin;
... etc
Such a header would allow typical existing programs to continue to compile.
---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<45bqcl$7gb@engnews2.Eng.Sun.COM>Path:
arc1-ca.pugleaf.net!128.32.155.1!mattReferences:
<45as8l$mf8@rational.rational.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt From: clamage@Eng.Sun.COM (Steve Clamage) Newsgroups: comp.std.c++ Subject: Re: STL <iostream> vs. <iostream.h> Date: 09 Oct 1995 21:39:17 GMT Organization: Sun Microsystems Inc. Approved: matt@physics2.Berkeley.EDU (Matt Austern) Message-ID: <45bqcl$7gb@engnews2.Eng.Sun.COM> References: <45as8l$mf8@rational.rational.com> Reply-To: clamage@Eng.Sun.COM NNTP-Posting-Host: physics2.berkeley.edu