NULL
De 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. |
Déclaré dans l'en-tête <cstddef> | ||
Déclaré dans l'en-tête <cstring> | ||
Déclaré dans l'en-tête <cwchar> | ||
Déclaré dans l'en-tête <ctime> | ||
Déclaré dans l'en-tête <clocale> | ||
Déclaré dans l'en-tête <cstdio> | ||
#define NULL /*implementation-defined*/ | ||
Définit la constante de pointeur NULL, ce qui est un prvalue expression intégrale de constante de type entier qui évalue à zéro ou un prvalue de std::nullptr_t type. Le pointeur null constante peut être implicitement convertie à tout type pointeur, les résultats transformation sur la valeur de pointeur null de ce type. Si la constante de pointeur nul est de type entier, il peut être converti en un type de prvalue de 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 implicitement convertie 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.
[modifier]Mise en œuvre possible
#define NULL 0//since C++11#define NULL nullptr |
[modifier]Exemple
#include <cstddef>class S;int main(){int* p = NULL;int* p2 =static_cast<std::nullptr_t>(NULL);void(*f)(int)= NULL;int S::*mp = NULL;void(S::*mfp)(int)= NULL;}
[modifier]Voir aussi
nullptr | le pointeur littéral qui spécifie un pointeur NULL (C++11) valeur 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) | le type de la nullptr pointeur null littéral 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) |