Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

alnite

if the reason they change iostream.h to iostream...

This topic is 5340 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

is for a compatibility purpose, why didn''t they do that for other header files as well? Why do some header files require .h? Yes, I do find the .h tag is quite unnecessary.

Share this post


Link to post
Share on other sites
Advertisement
Most of the headers I've used that are of the standard had prior .h counterparts. fstream is one that comes to mind right now. String has a string.h. math.h should be replaced with cmath and so on.

[edited by - nervo on March 29, 2004 9:54:44 PM]

Share this post


Link to post
Share on other sites
None of the standard headers in C++ require the .h extension.

If you write your own header or someone else supplies the header, you/they are free to give it whatever extension you/they feel like.

Share this post


Link to post
Share on other sites
quote:
Original post by SiCrane
If you write your own header or someone else supplies the header, you/they are free to give it whatever extension you/they feel like.
But why don''t they make it a standard too that the all header files shouldn''t have the .h extension? They did that with C++ standard header files.

Share this post


Link to post
Share on other sites
It is important to note that string.h became cstring, which is completely different than string

string.h/cstring: strlen, strcmp, etc.
string: STL''s basic_string, string

Share this post


Link to post
Share on other sites
quote:
Original post by alnite
But why don''t they make it a standard too that the all header files shouldn''t have the .h extension?
If you want a real revolution, ask them to get rid of header files once and for all.

Share this post


Link to post
Share on other sites
quote:
Original post by alnite
But why don''t they make it a standard too that the all header files shouldn''t have the .h extension? They did that with C++ standard header files.

Why should they? If I want to call my headers "somefile.h" or even "somefile.cow", what right does the standards committe have to say that I can''t? The standards committee doesn''t have any jurisdiction over my private code libraries.

Share this post


Link to post
Share on other sites
They took off the .h for all of the standard C++ headers I believe, as others have mentioned. People still use .h because a) it''s a handy convention and b) C still uses .h.

The C++ standard doesn''t affect the C standard and lots of people still use C, you know. But most people use .h when making headers because it''s just plain useful.

Share this post


Link to post
Share on other sites
quote:
Original post by SiCrane
quote:
Original post by alnite
But why don''t they make it a standard too that the all header files shouldn''t have the .h extension? They did that with C++ standard header files.

Why should they? If I want to call my headers "somefile.h" or even "somefile.cow", what right does the standards committe have to say that I can''t? The standards committee doesn''t have any jurisdiction over my private code libraries.
Well, that sounds like a valid reason.

@Roland
then there is no way of knowing which file is a C++ source.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!