Is using .h as a header for a C ++ file incorrect?

Incorrectly used .h as a header for a C ++ file?

I see this everywhere, especially with code written in the "C" style. I noticed that Emacs always selects the C highlight style for the .h header, but C ++ for hpp or hh.

Is this actually "wrong" to denote your .h headers, or is it something that annoys me?

EDIT:

There is a good (ish) reason why this annoys me, if I have project files with the words "hpp and cpp", I can leave with "grep something" pp ", etc., otherwise I need to enter" .h cpp

+3
source share
5

++.h. , . - MSVC .cpp Linux,.cc. , .h .

.hpp( .hh ) , .h.

+5

. Microsoft Visual ++.

, , .

+13

.h, .h, .hpp, .hxx, .hh whathaveyou. , .c C .c, .cpp, .cc .cxx ++. .

+3

-.c C,.cpp ++ - .h C,.hpp ++. /. , , , .

, Emacs .

+2

Emacs , .h C ++, C .h ++ .hpp.

, .hpp.

+2

Source: https://habr.com/ru/post/1704890/


All Articles