◐ Shell
clean mode source ↗

NULL – cppreference.com

Aus cppreference.com

<metanoindex/>

<tbody> </tbody>

definiert in Header

<cstddef>

definiert in Header

<cstring>

definiert in Header

<cwchar>

definiert in Header

<ctime>

definiert in Header

<clocale>

definiert in Header

<cstdio>

#define NULL /*implementation-defined*/

Definiert den Null-Zeiger-Konstante, die ein integraler konstanter Ausdruck prvalue von Integer-Typ, der auf Null wertet oder prvalue vom Typ std::nullptr_t ist. Die Null-Pointer-Konstante kann implizit konvertiert jedem Zeigertyp sein; eine solche Umwandlung Ergebnisse in den Null-Zeiger-Wert dieses Typs. Wenn die Null-Zeiger Konstante Integer-Typ, kann es zu einer prvalue vom Typ std::nullptr_t umgewandelt werden .

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 implizit konvertiert 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.

Mögliche Implementierung

#define NULL 0
//since C++11
#define NULL nullptr

Beispiel

#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;
}

Siehe auch

nullptr

der Zeiger wörtliche, die eine Null-Zeiger-Wert (C++11) angibt

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.

[edit]

die Art der Null-Zeiger wörtliche

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) [edit]