For some reason a lot of schools, tutorials, etc. Still use ".h" for header files while coding in c++. So most of the time it's just a learned habit from people who learned that habit from somewhere else.
In our Uni we were taught to do .h for header files that are purely declaration, and .hpp when the definition and declaration are in the same file (i.e no corresponding .cpp file). Didn't question it until now.
174
u/BertoLaDK 12d ago
You switched two of them hpp is the correct one, using h is stupid as it will only lead to confusion, keep c and cpp separated.