.h or .hpp

Started by
5 comments, last by ZGL_Sigma 22 years, 2 months ago
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 -
I hate signatures !!!
Advertisement
How do you make a hpp file?! I''ve never heard of them.
;-)
.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.

"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
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)
quote:Original post by George2
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.

Yes, they do. Take a look at www.boost.org


--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
>.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
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

This topic is closed to new replies.

Advertisement