Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Difference between *.hxx and *.h header files?

Reply
Thread Tools

Difference between *.hxx and *.h header files?

 
 
Mark Sullivan
Guest
Posts: n/a
 
      05-17-2008
What is the difference between the extensions *.hxx and just *.h for header files ?
Can they co-exist?

Mark

 
Reply With Quote
 
 
 
 
Christian Hackl
Guest
Posts: n/a
 
      05-17-2008
Mark Sullivan wrote:

> What is the difference between the extensions *.hxx and just *.h for header files ?


None, really. This is also an FAQ:

http://www.parashift.com/c++-faq-lit....html#faq-27.9

> Can they co-exist?


Yes.


--
Christian Hackl
 
Reply With Quote
 
 
 
 
peter koch
Guest
Posts: n/a
 
      05-17-2008
On 17 Maj, 17:12, ms...@nortel.com (Mark Sullivan) wrote:
> What is the difference between the extensions *.hxx and just *.h for header files ?
> Can they co-exist?
>
> Mark


Yes, no problem. You can call them whatever you want, and even
a .pascal extension would be fine - for the compiler! I would go for
an established convention of your platform, but would avoid .h as this
to me looks like a C header.

/Peter
 
Reply With Quote
 
Bart van Ingen Schenau
Guest
Posts: n/a
 
      05-17-2008
Mark Sullivan wrote:

> What is the difference between the extensions *.hxx and just *.h for
> header files ? Can they co-exist?


The difference is that one uses a three-letter extension, and the other
a one-letter one.

As far as a C or C++ compiler is concerned, there is no difference at
all. You could even use something like
*.some_silly_extension_i_like_to_use if you like.
The only thing that the compiler cares about is that it can find a file
with the name you specify and that the file contains syntactically
correct text.

>
> Mark


Bart v Ingen Schenau
--
a.c.l.l.c-c++ FAQ: http://www.comeaucomputing.com/learn/faq
c.l.c FAQ: http://c-faq.com/
c.l.c++ FAQ: http://www.parashift.com/c++-faq-lite/
 
Reply With Quote
 
Ulrich Eckhardt
Guest
Posts: n/a
 
      05-17-2008
Mark Sullivan wrote:
> What is the difference between the extensions *.hxx and just *.h for
> header files ?


There are a few *.h files who's content is defined by some standard. Other
than that, it is only customary (i.e. a convention, not a rule) that hxx
signals C++ header files like cxx is sometimes used for C++ sourcefiles.
However, you will see much more cpp or hpp files.

> Can they co-exist?


You can pretty much call your files as you want, neither C nor C++ actually
care much, apart from the few special cases that collide with header files
already used by the languages itself.

Uli

 
Reply With Quote
 
peter koch
Guest
Posts: n/a
 
      05-17-2008
On 17 Maj, 20:06, Ulrich Eckhardt <dooms...@knuut.de> wrote:
> Mark Sullivan wrote:
> > What is the difference between the extensions *.hxx and just *.h for
> > header files ?

>
> There are a few *.h files who's content is defined by some standard. Other
> than that, it is only customary (i.e. a convention, not a rule) that hxx
> signals C++ header files like cxx is sometimes used for C++ sourcefiles.
> However, you will see much more cpp or hpp files.
>
> > Can they co-exist?

>
> You can pretty much call your files as you want, neither C nor C++ actually
> care much, apart from the few special cases that collide with header files
> already used by the languages itself.
>
> Uli


You have to take care when you give a name already defined by the
standard, but I guess all major platforms will be able to differ so
long as you differentiate using ""-inclusion instead of "<>".

/Peter
 
Reply With Quote
 
HelloLinux
Guest
Posts: n/a
 
      05-17-2008
boost library uses .hpp while standard c library uses .h and standard c
++ library doesn't use any suffix.

They are just convention, and not different.

Mark Sullivan wrote:
> What is the difference between the extensions *.hxx and just *.h for header files ?
> Can they co-exist?
>
> Mark

 
Reply With Quote
 
Jim Langston
Guest
Posts: n/a
 
      05-18-2008
Mark Sullivan wrote:
> What is the difference between the extensions *.hxx and just *.h for
> header files ? Can they co-exist?


The extention of the header files is by convention. You can name a header
file anything you want.

#include "MyFile.bah"

is legal.

I've seen both .h and .hpp used for C++ header files. .H may even be a
likely extion. However, I would suggest you stick with the conventions as
it makes it easier to find things. Easier to search all .h or .h* files for
some specific thing you are looking for then have to guess what extention
the programmer used.


--
Jim Langston



 
Reply With Quote
 
Aggro
Guest
Posts: n/a
 
      05-18-2008
Mark Sullivan wrote:
> What is the difference between the extensions *.hxx and just *.h for header files ?
> Can they co-exist?


There is no difference from the point of view of the C++ which extension
you use. Generally .hxx is used for C++ headers and .h is used for C
headers while many use it for C++ headers also. The content of the file
is more important.
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      05-18-2008
Aggro wrote:

> Mark Sullivan wrote:
> > What is the difference between the extensions *.hxx and just *.h
> > for header files ? Can they co-exist?

>
> There is no difference from the point of view of the C++ which
> extension you use. Generally .hxx is used for C++ headers and .h is
> used for C headers while many use it for C++ headers also.


I've never seen .hxx used in real code. I've seen .hpp on occasion.




Brian
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
Difference between including a header file in .h and .cpp 'Mani C++ 4 04-03-2006 08:10 AM
Difference between bin and obj directories and difference between project references and dll references jakk ASP .Net 4 03-22-2005 09:23 PM
Difference between a library file and a header file in C s.subbarayan C Programming 4 05-21-2004 11:49 AM
Exact difference between 'const char *' and 'char *', also diff between 'const' and 'static' Santa C Programming 1 07-17-2003 02:10 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57