I've always used a *.h
file for my class definitions, but after reading some boost library code, I realised they all use *.hpp
. I've always had an aversion to that file extension, I think mainly because I'm not used to it.
What are the advantages and disadvantages of using *.hpp
over *.h
?
Here are a couple of reasons for having different naming of C vs C++ headers:
Remember, C is not C++ and it can be very dangerous to mix and match unless you know what you are doing. Naming your sources appropriately helps you tell the languages apart.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With