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. |
<metanoindex/>
<tbody> </tbody>| Dclar dans l'en-tte <cstddef>
|
||
| Dclar dans l'en-tte <cstring>
|
||
| Dclar dans l'en-tte <cwchar>
|
||
| Dclar dans l'en-tte <ctime>
|
||
| Dclar dans l'en-tte <clocale>
|
||
| Dclar dans l'en-tte <cstdio>
|
||
#define NULL /*implementation-defined*/ |
||
Dfinit la constante de pointeur NULL, ce qui est un prvalue expression intgrale de constante de type entier qui value zro ou un prvalue de std::nullptr_t type. Le pointeur null constante peut tre implicitement convertie tout type pointeur, les rsultats 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.
Mise en uvre possible
#define NULL 0
//since C++11
#define NULL nullptr
|
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;
}
Voir aussi
| nullptr | le pointeur littral qui spcifie 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 littral 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) |