NULL
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <cstddef>
|
||
| Defined in header <cstring>
|
||
| Defined in header <cwchar>
|
||
| Defined in header <ctime>
|
||
| Defined in header <clocale>
|
||
| Defined in header <cstdio>
|
||
| #define NULL /*implementation-defined*/ |
||
定义空指针常量,它是一个不可分割的的常量表达式prvalue的整数类型,其值为零或prvalue类型std::nullptr_t。可能是空指针常量隐式转换为任何指针类型,该类型的空指针值转换的结果。如果空指针常量整数类型,它可以被转换成一个prvalue类型std::nullptr_t.
Original:
Defines the null pointer constant, which is an integral constant expression prvalue of integer type that evaluates to zero or a prvalue of type std::nullptr_t. The null pointer constant may be 隐式转换 to any pointer type; such conversion results in the null pointer value of that type. If the null pointer constant has integer type, it may be converted to a prvalue of type std::nullptr_t.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 可能的实现
#define NULL 0 //since C++11 #define NULL nullptr |
[编辑] 为例
[编辑] 另请参阅
| nullptr | 指针常量,它指定一个空指针(C++11)
Original: the pointer literal which specifies a null pointer value (C++11) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| (C++11) |
类型的文字nullptr空指针 Original: the type of the null pointer literal nullptr The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (的typedef) |