C++ #ifndef for include files, why is all caps used for the header file?

后端 未结 7 1770
猫巷女王i
猫巷女王i 2021-01-06 12:32

I wonder why the name after the #ifndef directive is always all caps and don\'t seem to match the name of the actual header file? What are the rules surrounding

7条回答
  •  生来不讨喜
    2021-01-06 12:50

    You can use any name you want, but you want to make it unique so that value won't be defined outside your header by any chance, so using header name with uppercase is just a nice convention to ensure that.

提交回复
热议问题