-
July 28th, 2003, 09:41 AM #1Member
- Join Date
- Apr 2002
- Location
- Georgia
- Posts
- 137
What is the deal with C++ header files having no extension?
I seriously do not know why anyone ever considered changing the C++ header files from having .h extensions to having no extensions.
First of all, I just LIKE having extensions on everything. It just tells me, roughly, what type of a file it is.
If they didn't want to use conflicting C headers, then why didn't they (and by "they", I mean the people who decided to do this) simply give the extension of .ch or .cxh or something like that???
Extensions BELONG on files, for crying out loud! They are a means of identification.Jüš† ä €öm¶ù†Ê® §ÇÌÈñŒ mÅjÒ®
-
August 29th, 2003, 04:12 PM #2
Where's this come from? All C++/C compilers I've used use the .h extension, along with the C/CPP libraries.
_____
NuKeS
-
September 5th, 2003, 03:24 PM #3
nukes, the newer C++ convention is to include library files without an extension (e.g. #include <iostream> instead of #include <iostream.h>). Compilers like GNU g++ will use this standard, but still accept the other one.
I think a lot of it has to do with quicker differentiation between standard libraries and user defined classes (who are still included by filename...usually with a .h on the end). IMO, it's an oversimplification of issue, but I suppose it might help newcomers to the language see the distinction maybe?
As I mentioned in the first paragraph, you CAN still include them with a .h if it makes you feel better. You will get a compiler message saying you are using an outdated convention, but that can be turned of with a compiler/linker flag in a makefile!
Just a thought...
Last edited by squeech; September 5th, 2003 at 03:26 PM.
Talking in numbers doesn't make you smarter.
-
September 5th, 2003, 05:21 PM #4Member
- Join Date
- Apr 2002
- Posts
- 59
This is why you use Java...
Package names are just so darn easy!
But I will admit I'm not a fan of CLASSPATH's so thank god our envrionment guys take care of that.
-
September 5th, 2003, 05:49 PM #5Member
- Join Date
- Jul 2003
- Posts
- 113
Java has to many errors, the runtimes dont work well for me C++ is more "simpler?"Originally posted by JohnRoboto
This is why you use Java...
Package names are just so darn easy!
But I will admit I'm not a fan of CLASSPATH's so thank god our envrionment guys take care of that.Intel e6400 Conroe @ 1300MHZ!! GRR
2048MB CORSAIR XMS5300 DDR2 RAM
Nvidia eVGA 7600GT
-
September 5th, 2003, 11:18 PM #6Member
- Join Date
- Apr 2002
- Posts
- 59
Java has too many errors? Problems with runtimes? Hmmm.... sounds strange. Can you tell me about any specific experiences? Maybe I can help out.Originally posted by JeremyPC
Java has to many errors, the runtimes dont work well for me C++ is more "simpler?"
-
September 10th, 2003, 10:56 PM #7Member
- Join Date
- Apr 2002
- Location
- Georgia
- Posts
- 137
Well, if this were the case, wouldn't the already existing sytax of using #include <header.h> for built-in headers and using #include "header.h" for user-made ones serve the same purpose? Essentially, that makes this new "feature" redundant.Originally posted by squeech
nukes, the newer C++ convention is to include library files without an extension (e.g. #include <iostream> instead of #include <iostream.h>). Compilers like GNU g++ will use this standard, but still accept the other one.
I think a lot of it has to do with quicker differentiation between standard libraries and user defined classes (who are still included by filename...usually with a .h on the end). IMO, it's an oversimplification of issue, but I suppose it might help newcomers to the language see the distinction maybe?
As I mentioned in the first paragraph, you CAN still include them with a .h if it makes you feel better. You will get a compiler message saying you are using an outdated convention, but that can be turned of with a compiler/linker flag in a makefile!
Just a thought...
Jüš† ä €öm¶ù†Ê® §ÇÌÈñŒ mÅjÒ®
-
September 13th, 2003, 10:51 AM #8Junior Member
- Join Date
- Sep 2003
- Posts
- 1
ww3
if your an experienced programer, artist, sound editor, 3d modeler or any of that stuff i would like you to help me of a free
game that will soon be free for download on the web site. i have not finished the web site, and i do not know what the url will be.
more about the game:
the game is going to be called World War III. thats where the third world war has begun and you get to lead a country and try to make it be the one that conqours the world. its going to have mouse controls like age of empires, command & conquer, and rise of nations, and its going to have real size countrys, or at least as big as i can get them. its going to have all the modern weapons that the us military uses. but its not an all military game, you still have civilians, when civilians are under attack you have to deploy emergency vehicals, and it will have a feature where if you get desprete you can send out civilians to fight the enemy army.(alot of good that will do, huh)? and you will stay in your white house or where ever the leader of the country you are leading lives, and if its destroyed you will be inside so you will lose. you will have to make sure that is alwasy defended.
this game is being written in C++
im using c++ builder 4 standard
when i get the web site going ill put the website going ill put the url on the forums so any one can help.
if you have an code that can be useful, email it to me at frosteebob@yahoo.com, do not send it as an attachment, put the
code as the body of the email.
if you have an urls of websites where i can download tools, 3d models, graphics, sounds, videos, ect. please email those to me to
when i get the site going you will be able to upload your own stuff to help.
and dont forget to leave your name so i can put you in the credits for this game
-
September 14th, 2003, 06:29 AM #9Junior Member
- Join Date
- Sep 2003
- Posts
- 1
It's all about namespaces. C++ defines a standard namespace called "std", which assumes a .h extension for header files. In C++ you would have:
#include <iostream>
using namespace std;
Whereas C is just:
#include <stdio.h>
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)



LinkBack URL
About LinkBacks



Reply With Quote


Road to work! :) My legs are stiff and my ass is sore! :)
Is It Just Me? v233893843