Why it's valid to include a header file twice in c++?

后端 未结 7 1035
迷失自我
迷失自我 2021-02-09 17:25
#include \"DLLDefines.h\"
#include \"DLLDefines.h\"

The above actually passed compilation, but why?

7条回答
  •  忘掉有多难
    2021-02-09 18:06

    DLLDefines.h may also have #pragma once at the top, #pragma once ensures that file gets included only once.

提交回复
热议问题