Error: macro names must be identifiers using #ifdef 0

后端 未结 5 1387
悲哀的现实
悲哀的现实 2020-12-12 20:42

I have the source code of an application written in C++ and I just want to comment something using:

#ifdef 0
...
#endif

And I get this erro

5条回答
  •  情书的邮戳
    2020-12-12 21:35

    This error can also occur if you are not following the marco rules

    Like

    #define 1K 1024 // Macro rules must be identifiers error occurs
    

    Reason: Macro Should begin with a letter, not a number

    Change to

    #define ONE_KILOBYTE 1024 // This resolves 
    

提交回复
热议问题