Computer Science, asked by Sakshipd, 1 year ago

List all the fundamental data type as per the C++11.

Answers

Answered by Anonymous
3
(See also type for type system overview and the list of type-related utilities that are provided by the C++ library)

Void type

void - type with an empty set of values. It is an incomplete type that cannot be completed (consequently, objects of type void are disallowed). There are no arrays of void, nor references to void. However, pointers to void and functionsreturning type void (procedures in other languages) are permitted.

std::nullptr_t

Defined in header <cstddef>

typedef decltype(nullptr) nullptr_t;

(since C++11)

std::nullptr_t is the type of the null pointer literal, nullptr. It is a distinct type that is not itself a pointer type or a pointer to member type.

Boolean type

bool - type, capable of holding one of the two values: true or false. The value of sizeof(bool) is implementation defined and might differ from 1.

Character types

signedchar - type for signed character representation.

unsignedchar - type for unsigned character representation. Also used to inspect object representations(raw memory).

char - type for character representation which can be most efficiently processed on the target system (has the same representation and alignment as either signedchar or unsignedchar, but is always a distinct type). Multibyte characters strings use this type to represent code units. The character types are large enough to represent any UTF-8 code unit (since C++14). The signedness of chardepends on the compiler and the target platform: the defaults for ARM and PowerPC are typically unsigned, the defaults for x86 and x64 are typically signed.

wchar_t - type for wide character representation (see wide strings). Required to be large enough to represent any supported character code point (32 bits on systems that support Unicode. A notable exception is Windows, where wchar_t is 16 bits and holds UTF-16 code units) It has the same size, signedness, and alignment as one of the integer types, but is a distinct type.

char16_t - type for UTF-16 character representation, required to be large enough to represent any UTF-16 code unit (16 bits). It has the same size, signedness, and alignment as std::uint_least16_t, but is a distinct type.

char32_t - type for UTF-32 character representation, required to be large enough to represent any UTF-32 code unit (32 bits). It has the same size, signedness, and alignment as std::uint_least32_t, but is a distinct type.

(since C++11)

Integer types

int - basic integer type. The keyword int may be omitted if any of the modifiers listed below are used. If no length modifiers are present, it's guaranteed to have a width of at least 16 bits. However, on 32/64 bit systems it is almost exclusively guaranteed to have width of at least 32 bits (see below).

Modifiers

Modifies the integer type. Can be mixed in any order. Only one of each group can be present in type name.

Signedness

signed - target type will have signed representation (this is the default if omitted)

unsigned - target type will have unsigned representation

Size

short - target type will be optimized for space and will have width of at least 16 bits.

long - target type will have width of at least 32 bits.

longlong - target type will have width of at least 64 bits.

(since C++11)

Note: as with all type specifiers, any order is permitted: unsignedlonglongint and longintunsignedlong name the same type.

Similar questions