Archived

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

ZGL_Sigma

.h or .hpp

Recommended Posts

is there any difference between both - I ever used to use .h files and not .hpp - but it sounds more logic when you got .cpp and .hpp files than having .cpp and .h files -

Share this post


Link to post
Share on other sites
.c = c file
.cpp = c++ file
.h = header file
.hpp = doesn''t exist

It''s very logical

You could ofcourse rename all you .h files in .hpp and do
#include "header.hpp" in stead of #include "header.h".
But nobody does that.

Share this post


Link to post
Share on other sites
I''ve seen people use .hpp .
I don''t know if it''s correct or not. But it''s really up to
yourself how you do it. Some use .cc instead of .cpp .
Just choose what sound most logical to you. If other people are
going to be using your files it may make sence to choose the common names (.cpp and .h I belive)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
>.c = c file
>.cpp = c++ file
>.h = header file
>.hpp = doesn''t exist

bullshit! lots of people use .hpp files. im one of them.
.hpp = c++ header file
and don''t forget .cxx .hxx .cc .hh and all the rest i forgot...

/emptyhead

Share this post


Link to post
Share on other sites
IMO it makes perfect sense to use hpp, and I know of at least one major library (www.boost.org) that uses this convention.

C++ itself doesn't care what file-extensions are used (in fact, the std headers have no extension at all, and aren't even guaranteed to be files). On UNIX usually .cc and .h are used, occasionally you see .cc/.hh, .C/.H, .cxx/.hxx, .inl, etc.

a .hpp extension makes it obvious that you're using a C++ only header, .h doesn't.

EDIT: looks like I'm not the only one...

Edited by - kvh on February 17, 2002 11:12:20 AM

Share this post


Link to post
Share on other sites