Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
October 04, 2006 #include <iostream.h> versus #include <iostream> | ||||
---|---|---|---|---|
| ||||
I used C++ 5 years ago and am currently refreshing myself on the language and I notice in some of the posts use of #include <iostream> versus the more traditional #include <iostream.h>. Why is this the case? In my installation I have (relative to the base): ./include/iostream.h ./stlport/src/iostream.cpp ./stlport/stlport/iostream ./stlport/stlport/iostream.h ./stlport/stlport/using/iostream ./stlport/stlport/using/h/iostream.h ./stlport/stlport/wrap_std/iostream ./stlport/stlport/wrap_std/h/iostream.h so I notice no iostream in ./include and 3 versions of iostream from in the ./stlport directory tree. Which one should I be using? Thanks, Edward |
October 04, 2006 Re: #include <iostream.h> versus #include <iostream> | ||||
---|---|---|---|---|
| ||||
Posted in reply to Edward A. Waugh | Edward A. Waugh wrote:
>
> so I notice no iostream in ./include and 3 versions of
> iostream from in the ./stlport directory tree.
>
> Which one should I be using?
<iostream> should be used rather than <iostream.h>
This is true in general for all standard library headers. Note that some of the C-legacy headers have a slightly different naming convention: math.h functionality is now accessed via <cmath>.
Pick up a copy of Stroustrup and/or Josuttis for reference.
|
October 05, 2006 Re: #include <iostream.h> versus #include <iostream> | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gregg | Thats is fine but #include <iostream> does not work because the include directory in my installation only has iostream.h (Why is this case?) Thus my question about which iostream file to use from the stlport directory tree assuming that they are versions of iostream that I should be using. - Edward |
October 05, 2006 Re: #include <iostream.h> versus #include <iostream> | ||||
---|---|---|---|---|
| ||||
Posted in reply to Edward A. Waugh | Edward A. Waugh wrote:
> Thats is fine but #include <iostream> does not work because
> the include directory in my installation only has iostream.h
> (Why is this case?) Thus my question about which iostream
> file to use from the stlport directory tree assuming that
> they are versions of iostream that I should be using.
>
> - Edward
Use the one in ./stlport/stlport/iostream per your original post.
dmc -Ic:\dm\stlport\stlport YourFile.cpp
|
October 24, 2006 Re: #include <iostream.h> versus #include <iostream> | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gregg | Are we cursed or blessed to have to either use using namespace std; everywhere or prefix everything with std::? I don't mind std::cout and std::endl but std::list or std::map really annoys me. - Edward |
October 27, 2006 Re: #include <iostream.h> versus #include <iostream> | ||||
---|---|---|---|---|
| ||||
Posted in reply to Edward A. Waugh |
Edward A. Waugh wrote:
> Are we cursed or blessed to have to either use
>
> using namespace std;
>
> everywhere or prefix everything with std::?
>
> I don't mind std::cout and std::endl but std::list or
> std::map really annoys me.
>
> - Edward
On my experience this is very useful. It is possible for more than one header file to implement e.g. list and it is important to be able to control what is being used where.
Best wishes
John Fletcher
|
Copyright © 1999-2021 by the D Language Foundation