zoukankan      html  css  js  c++  java
  • Visual Studio #ifdef 0 编译报错 fatal error C1016: #if[n]def expected an identifier

    出处: https://stackoverflow.com/questions/426736/error-macro-names-must-be-identifiers-using-ifdef-0

    The #ifdef directive is used to check if a preprocessor symbol is defined. The standard (C11 6.4.2 Identifiers) mandates that identifiers must not start with a digit:

    identifier:
        identifier-nondigit
        identifier identifier-nondigit
        identifier digit
    identifier-nondigit:
        nondigit
        universal-character-name
        other implementation-defined characters>
    nondigit: one of
        _ a b c d e f g h i j k l m
        n o p q r s t u v w x y z
        A B C D E F G H I J K L M
        N O P Q R S T U V W X Y Z
    digit: one of
        0 1 2 3 4 5 6 7 8 9

    The correct form for using the pre-processor to block out code is:

    #if 0
    : : :
    #endif

    You can also use:

    #ifdef NO_CHANCE_THAT_THIS_SYMBOL_WILL_EVER_EXIST
    : : :
    #endif

    ut you need to be confident that the symbols will not be inadvertently set by code other than your own. In other words, don't use something like NOTUSED or DONOTCOMPILE which others may also use. To be safe, the #if option should be preferred.

     answered Jan 9 '09 at 1:38
  • 相关阅读:
    python爬取网络上图片【小例子】
    python统计英文单词出现次数【小例子】
    python敏感字处理【小例子】
    platform操作系统信息
    迭代器
    xxxxx
    test
    Jquery
    Jquery二
    DOM文档对象模型
  • 原文地址:https://www.cnblogs.com/liujx2019/p/14307726.html
Copyright © 2011-2022 走看看