Preprocessor directive #ifndef for C/C++ code

后端 未结 7 1709
傲寒
傲寒 2021-02-12 22:25

In eclipse, whenever I create a new C++ class, or C header file, I get the following type of structure. Say I create header file example.h, I get this:

7条回答
  •  终归单人心
    2021-02-12 22:54

    This is just a common way to protect your includes - in this way it prevents the code from being included twice. And the identifier used could be anything, it's just convention to do it the way described.

提交回复
热议问题