NULL
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'header <cstddef>
|
||
| Elemento definito nell'header <cstring>
|
||
| Elemento definito nell'header <cwchar>
|
||
| Elemento definito nell'header <ctime>
|
||
| Elemento definito nell'header <clocale>
|
||
| Elemento definito nell'header <cstdio>
|
||
#define NULL /*implementation-defined*/ |
||
Definisce la costante di puntatore nullo, che è un prvalue integrante un'espressione costante di tipo intero che restituisce zero o un prvalue di std::nullptr_t tipo. Il puntatore nullo costante può essere conversione implicita a qualsiasi tipo di puntatore, i risultati di conversione tipo nel puntatore nullo valore di quel tipo. Se la costante puntatore nullo è di tipo intero, esso può essere convertito in un tipo di 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 conversione implicita 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.
Possibile implementazione
#define NULL 0
//since C++11
#define NULL nullptr
|
Esempio
#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;
}
Vedi anche
| nullptr | il puntatore letterale che specifica un valore nullo (C++11) valore del puntatore
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) |
il tipo di puntatore nullo nullptr letterale 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) |