Tutorial by Examples

A type specifier; when applied to a type, produces the const-qualified version of the type. See const keyword for details on the meaning of const. const int x = 123; x = 456; // error int& r = x; // error struct S { void f(); void g() const; }; const S s; s.f(); // error s...
C++11 Yields the type of its operand, which is not evaluated. If the operand e is a name without any additional parentheses, then decltype(e) is the declared type of e. int x = 42; std::vector<decltype(x)> v(100, x); // v is a vector<int> If the operand e is a class member...
A keyword that is part of certain integer type names. When used alone, int is implied, so that signed, signed int, and int are the same type. When combined with char, yields the type signed char, which is a different type from char, even if char is also signed. signed char has a range that inclu...
A type specifier that requests the unsigned version of an integer type. When used alone, int is implied, so unsigned is the same type as unsigned int. The type unsigned char is different from the type char, even if char is unsigned. It can hold integers up to at least 255. unsigned can also be ...
A type qualifier; when applied to a type, produces the volatile-qualified version of the type. Volatile qualification plays the same role as const qualification in the type system, but volatile does not prevent objects from being modified; instead, it forces the compiler to treat all accesses to suc...

Page 1 of 1