A null pointer has a set value called a null pointer constant to indicate that the cursor does not point to any valid object or function. You can use blank references in the following cases:
A null pointer is a fixed number that evaluates to zero. For example, a fixed null pointer could be 0, NULL, or such a stream cannot be broadcast to type (empty *) 0. C ++ 11 defines a new fixed null pointer that can be converted to any type of cursor, point-to-member type, or bool type
You can specify any of the following null pointer constant values:
NOTE: You must define NULL before use
0
You can use a fixed number sentence with the value 0 or a slash in (empty *) 0 as a null pointer constant.
The macro NULL and the value of 0 are equal to the empty indicators, but NULL is pure because it represents the purpose of constant use of the identifier.C ++ 11 startup only.
Nullptr is a null and void identifier. In C ++, launching empty point 0 or NULL has the following problems:
To solve the problems of null pointer constants, C ++ 11 introduced a new keyword nullptr. A fixed nullptr can be separated from the 0 most overloaded functions.
|