if the reason they change iostream.h to iostream...
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.
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]
[edited by - nervo on March 29, 2004 9:54:44 PM]
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.
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.
quote:Original post by SiCraneBut 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.
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.
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
string.h/cstring: strlen, strcmp, etc.
string: STL''s basic_string, string
quote:Original post by alniteIf you want a real revolution, ask them to get rid of header files once and for all.
But why don''t they make it a standard too that the all header files shouldn''t have the .h extension?
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.
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.
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.
quote:Original post by SiCraneWell, that sounds like a valid reason.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.
@Roland
then there is no way of knowing which file is a C++ source.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement