首页 > 代码库 > Programming languages — C/C++

Programming languages — C/C++

Types

void

The (nonexistent) value of a void expression (an expression that has type void) shall not be used in any way, and implicit or explicit conversions (except to void) shall not be applied to such an expression. If an expression of any other type is evaluated as a void expression, its value or designator is discarded. (A void expression is evaluated for its side effects.)

void;

nullptr 

both (int*)0 and nullptr are valid template-arguments for a non-type template-parameter of type “pointer to int.”

【null pointer constant】

An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.66) If a null pointer constant is converted to a pointer type, the resulting pointer, called a null pointer, is guaranteed to compare unequal to a pointer to any object or function

nullptr对应的一定是指针型变量,而null对应的有可能是指针型变量或者常量0

Types *val = nullptr;

auto

bool

true

flase

char

char16_t

char32_t

wchar_t

int

float

double

unsigned

signed

short

long

Programming languages — C/C++