NUL undeclared- first use in this function

后端 未结 4 1629
太阳男子
太阳男子 2020-12-21 15:53

From the web I understand that C contains NUL keyword.

But while compiling I get an error

NUL undeclared first use in this function\'
         


        
4条回答
  •  生来不讨喜
    2020-12-21 16:39

    It's NULL, not NUL.

    EDIT

    Did you even read the link you posted? It says very specifically "NULL is not NUL. NUL is not a defined keyword in C++"

    NULL is a macro defined in for the null pointer.
    NUL is the name of the first character in the ASCII character set. It corresponds to a zero value. There?s no
    standard macro NUL in C, but some people like to define it.
    The digit 0 corresponds to a value of 80, decimal. Don?t confuse the digit 0 with the value of ?? (NUL)!
    NULL can be defined as ((void*)0), NUL as ??.

提交回复
热议问题