NULL
Da 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. |
Definido no cabeçalho <cstddef>
|
||
Definido no cabeçalho <cstring>
|
||
Definido no cabeçalho <cwchar>
|
||
Definido no cabeçalho <ctime>
|
||
Definido no cabeçalho <clocale>
|
||
Definido no cabeçalho <cstdio>
|
||
#define NULL /*implementation-defined*/ |
||
Define a constante ponteiro nulo, que é uma expressão integral prvalue constante do tipo inteiro que avalia a zero ou um prvalue de std::nullptr_t tipo. O ponteiro nulo constante pode ser convertidos implicitamente a qualquer tipo de ponteiro; resultados de conversão desse tipo no valor de ponteiro nulo do tipo. Se a constante de ponteiro nulo tem tipo inteiro, ele pode ser convertido para um tipo de 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 convertidos implicitamente 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.
[editar] Possível implementação
#define NULL 0 //since C++11 #define NULL nullptr |
[editar] Exemplo
#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; }
[editar] Veja também
nullptr | o ponteiro literal que especifica um valor nulo (C++11) ponteiro
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) |
o tipo de nullptr ponteiro nulo literal 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) |