»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 07-28-2003, 07:41 AM   #1 (permalink)
Registered User
 
Join Date: Apr 2002
Location: Georgia
Posts: 137
Jüš† ä gü¥ is on a distinguished road
Kids 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Ò®
Jüš† ä gü¥ is offline   Reply With Quote
Old 08-29-2003, 02:12 PM   #2 (permalink)
Registered User
 
nukes's Avatar
 
Join Date: Oct 2002
Location: Scotland, UK
Posts: 2,946
nukes is on a distinguished road
Send a message via AIM to nukes Send a message via Yahoo to nukes
Where's this come from? All C++/C compilers I've used use the .h extension, along with the C/CPP libraries.
__________________
_____
NuKeS
nukes is offline   Reply With Quote
Old 09-05-2003, 01:24 PM   #3 (permalink)
Registered User
 
squeech's Avatar
 
Join Date: May 2002
Location: Rocky Mountain High
Posts: 522
squeech is on a distinguished road
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...
__________________
Talking in numbers doesn't make you smarter.

Last edited by squeech; 09-05-2003 at 01:26 PM.
squeech is offline   Reply With Quote
Old 09-05-2003, 03:21 PM   #4 (permalink)
Registered User
 
Join Date: Apr 2002
Posts: 58
JohnRoboto is on a distinguished road
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.
JohnRoboto is offline   Reply With Quote
Old 09-05-2003, 03:49 PM   #5 (permalink)
Registered User
 
Join Date: Jul 2003
Posts: 85
JeremyPC is on a distinguished road
Quote:
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.
Java has to many errors, the runtimes dont work well for me C++ is more "simpler?"
__________________
AMD Athlon XP 2800+ @ 2.7Ghz
1028 MB - 512 MB + 256x2 Corsair RAM
ASUS A7N8X-X Motherboard nForce2
ATI Radeon 9600 Pro
17" Samsung Flat Panel Monitor
JeremyPC is offline   Reply With Quote
Old 09-05-2003, 09:18 PM   #6 (permalink)
Registered User
 
Join Date: Apr 2002
Posts: 58
JohnRoboto is on a distinguished road
Quote:
Originally posted by JeremyPC

Java has to many errors, the runtimes dont work well for me C++ is more "simpler?"
Java has too many errors? Problems with runtimes? Hmmm.... sounds strange. Can you tell me about any specific experiences? Maybe I can help out.
JohnRoboto is offline   Reply With Quote
Old 09-10-2003, 08:56 PM   #7 (permalink)
Registered User
 
Join Date: Apr 2002
Location: Georgia
Posts: 137
Jüš† ä gü¥ is on a distinguished road
Quote:
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...
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.
__________________
Jüš† ä €öm¶ù†Ê® §ÇÌÈñŒ mÅjÒ®
Jüš† ä gü¥ is offline   Reply With Quote
Old 09-13-2003, 08:51 AM   #8 (permalink)
Registered User
 
Join Date: Sep 2003
Posts: 1
frosteebob is on a distinguished road
Food 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
frosteebob is offline   Reply With Quote
Old 09-14-2003, 04:29 AM   #9 (permalink)
Registered User
 
Join Date: Sep 2003
Posts: 1
fishybawb is on a distinguished road
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>
fishybawb is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 01:37 AM.