karthikbalaguru wrote:
What could be the advantage of using '.hpp' extension over '.h'
extension ?
If you see a file with the extension '.h' you can't know if it's a
C header or a C++ header without looking at its contents (and even then
it might not be immediately obvious). You obviously can't use a C++
header in a C program, although in a few cases the opposite is true too.
More importantly, editor programs which support, for example, syntax
highlighting cannot know if it's a C or a C++ file without complex
deductions from the file contents. I assume that most such editors
simply always assume that it's one or the other, getting it wrong
sometimes, thus giving you wrong syntax highlighting.
Why use a confusing naming convention when you can use a clearer one?
What would be the advantage of using '.h' for C++ headers, given that
they can be easily confused with C headers?