What is the difference between . h and . hpp and when to use (C++)

Asked

Viewed 433 times

2

Files . h are used in C/C++ as header files where all their contents are automatically passed to another file. cpp and your choice using the command:

#include <arquivo.h>

But recently I saw a code where the header files were like . hpp instead of . h , I tested to change some codes here on my computer by renaming the header files and hear no apparent difference. So what’s the difference between . h and . hpp ? When to use one and when to use another ?

  • By the answer of the other question, the only difference between . h and . hpp is that . hpp can only be used in C++ ? That’s all ?

  • yes. Even, when you want the library to be used in C and C++, it should be .h and roughly can’t use the C++ stuff without protecting with ifdefs

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.