Does anyone actually use the .hpp file extension for C++ header files? I've never seen it used, but I was just working with geany, and I noticed that it only syntax highlights C++ specific things if the file extension is .hpp (or .cpp, obviously, but not .h).

So what's the deal with that?

Recommended Answers

All 4 Replies

It's a bit unusual, but is one of the extensions usable for C++ header files.

It seems that the boost libraries use .hpp.

From what I understand, as long as a file has C++ syntax in it, it can be used as part of a C++ project ( if its a resource file its a different story I suppose, since I haven't really messed around with those @_@).

For example, the iostream header files, etc have no extensions. They're just 'raw files' with C++ syntax in them. You could probably get away with making up a fake extension that the computer doesn't recognize as a part of any program and still be able to use it in a C++ program so long as you're including it.

This is an assumption though, given the way headers are linked during compile time (its like adding the data from different files into one single file to be executed - so really I don't see why the extension matters @_@ )

-Alex

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.