Title: Theory / Unimportant / CS / Programming / C++ / Manual / Norm / 06 Types;
Tags: computer_to_instruction seen_description hasSeenConjDef

Name: The type of x
Definition: Something which determines which kind of operations can be applied to the value interpreted by x
Page: 136
Chapter: 6
Section: 2
Variables: x a variable
Context: C++ standard

Name: The fundamental types of C++
Definition: bool
Page: 138
Chapter: 6
Section: 2
Context: C++ standard
Definition2: character type
Conjdef: all of
Definition3: integer type
Definition4: floating point types
Definition5: void

Name: postfix declarator operators
Definition: () for function
Page: 138, 154
Chapter: 6
Section: 2, 3.1
Context: C++ standard
Definition2: [] for arrays
Conjdef: After a base type, adding
Definition3: -> return from function

Name: declarator operator
Definition: An operator acting on a declarator to transform it into another declarator.
Page: 138, 154
Chapter: 6
Section: 2, 3.1
Context: C++ standard
Conjdef: After a type, adding

Name: prefix declarator operators
Definition: * for pointer
Page: 138, 154
Chapter: 6
Section: 2, 3.1
Context: C++ standard
Definition2: *const for constant pointer
Conjdef: Before a base type, adding
Definition3: & for lvalue references
Intuition: A constant pointer
Definition4: *volatile for volatile pointer
Definition5: auto for function (using suffix return type)
Definition6: && rvalue reference

Name: Additional types
Definition: Data structure
Page: 138
Chapter: 6
Section: 2
Context: C++ standard
Definition2: class
Conjdef: All of
Definition3: enumeration

Name: C++ types
Definition: fundamental types
Page: 138
Chapter: 6
Section: 2
Context: C++ standard
Definition2: additional types
Conjdef: All of
Definition3: declarator operator applied to a type

Name: Integral types
Definition: boolean
Page: 138
Chapter: 6
Section: 2
Context: C++ standard
Definition2: character type
Conjdef: All of
Definition3: integer type

Name: Arithmetic types
Definition: Integral type
Page: 138
Chapter: 6
Section: 2
Context: C++ standard
Definition2: Floating point types
Conjdef: All of

Name: User-defined types
Definition: Enumeration
Page: 138
Chapter: 6
Section: 2
Context: C++ standard
Definition2: class
Conjdef: All of

Name: built-in types
Definition: Fundamental types
Page: 138
Chapter: 6
Section: 2
Context: C++ standard
Definition2: pointers
Conjdef: All of
Definition3: references

Question: when converted to int, foo is
Answer: 1 if foo==true
0 if foo==false
Page: 138
Chapter: 6
Section: 2.2
Variables: bool foo
Context: C++ standard

Question: when converted to bool, foo is
Answer: foo != nullptr
Page: 140
Chapter: 6
Section: 2.2
Variables: foo a pointer
Context: C++ standard

Question: (bool) n;
Answer: n != 0
Page: 140
Chapter: 6
Section: 2.2
Variables: n a numeric variable

Typ: char
Meaning: Default character type, usually 8 bit
Page: 140
Language: C++
Chapter: 6
Section: 2.3
Etymology: character

Typ: signed char
Meaning: Version of char that can hold both positive and negative values
Page: 140
Language: C++
Chapter: 6
Section: 2.3

Typ: unsigned char
Meaning: Version of char that can hold only positive values
Page: 140
Language: C++
Chapter: 6
Section: 2.3

Typ: wchar_t
Meaning: implementation-defined and large enough to hold the largest character set supported by the implementation’s locale
Page: 140
Language: C++
Chapter: 6
Section: 2.3

Typ: char16_t
Meaning: A type for holding 16-bit character sets
Page: 140
Language: C++
Chapter: 6
Section: 2.3

Typ: char32_t
Meaning: A type for holding 32-bit character sets
Page: 140
Language: C++
Chapter: 6
Section: 2.3

Instruction: int{c}
Page: 140
Effect: The integer value of c
Language: C++
Chapter: 6
Section: 2.3
Variables: c a char

Instruction: 'c'
Page: 143
Language: C++
Chapter: 6
Section: 2.3.2
Returns: a character representing c
Variables: c a single character
Name: Character literal

Instruction: \ooo
Page: 143
Language: C++
Context: character/string
Chapter: 6
Section: 2.3.2
Returns: the character whose octal number is ooo
Name: Octal number

Instruction: \xhhh
Page: 143
Language: C++
Chapter: 6
Section: 2.3.2
Returns: the character whose octal hexadecimal number is hhh
Name: Hexadecimal number

Instruction: U'\UXXXXXXXX'
Page: 143
Language: C++
Chapter: 6
Section: 2.3.2
Returns: The unicode character whose hexadecimal number is XXXXXXX

Instruction: u'\uXXXX' or u'\xXXXX'
Page: 143
Language: C++
Chapter: 6
Section: 2.3.2
Returns: The unicode character whose hexadecimal number is 0000XXXX

Question: What is a good use of unsigned int
Answer: array of boolean
Page: 145
Chapter: 6
Section: 2.4

Question: What is a bad use of unsigned int
Answer: Having one more bit for number representation
Page: 145
Chapter: 6
Section: 2.4

Question: By default, ints are signed or unsigned ?
Answer: signed
Page: 145
Chapter: 6
Section: 2.4

Typ: intn_t
Meaning: A signed int with at least n bits
Page: 145
Language: C++
Chapter: 6
Section: 2.4
Variables: n a power of 2 at least 8

Typ: uintn_t
Meaning: An unsigned int with at least n bits
Page: 145
Language: C++
Chapter: 6
Section: 2.4
Variables: n a power of 2 at least 8

Name: An extended integer type
Definition: A type, behaving like integer, considered integer type when considering conversion, integer literal values
Page: 145
Chapter: 6
Section: 2.4
Intuition: They may have greater range than standard integer type

Instruction: 0xnnn
Page: 145
Language: C++
Chapter: 6
Section: 2.4
Returns: The hexadecimal integer nnn

Instruction: 0nnn
Page: 145
Language: C++
Chapter: 6
Section: 2.4
Returns: The octal integer nnn

Instruction: nU or nu
Page: 145
Language: C++
Chapter: 6
Section: 2.4
Returns: n as an unsigned integer.
Variables: n an integer (hexadecimal, decimal or octal)

Instruction: nL or nl
Page: 145
Language: C++
Chapter: 6
Section: 2.4
Returns: n as a long
Variables: n an integer (hexadecimal, decimal or octal)

Instruction: nLL or nll
Page: 145
Language: C++
Chapter: 6
Section: 2.4
Returns: n as a long long
Variables: n an integer (hexadecimal, decimal or octal)

Question: What is a type of a number in an expression
Answer: The smallest type, at least int, respecting the constraint of the expression (U, L, LL) allowing to represent the number
Page: 145
Chapter: 6
Section: 2.4

Typ: float
Meaning: single precision floating point number
Page: 145
Language: C++
Chapter: 6
Section: 2.5

Typ: double
Meaning: double precision floating point number
Page: 145
Language: C++
Chapter: 6
Section: 2.5

Typ: long double
Meaning: extended-precision floating point number
Page: 145
Language: C++
Chapter: 6
Section: 2.5

Instruction: rf
Page: 145
Effect: r encoded as a float
Language: C++
Chapter: 6
Section: 2.5
Variables: r a floating point literal

Instruction: rl or rL
Page: 145
Effect: r encoded as a long double
Language: C++
Chapter: 6
Section: 2.5
Variables: r a floating point literal

Question: What are the use of void
Answer: Indicating a function does not return value
Page: 145
Chapter: 6
Section: 2.7
Answer2: As pointer of unknown type

Instruction: sizeof(t)
Page: 145
Language: C++
Chapter: 6
Section: 2.7
Returns: The ratio between the size of t and the size of char
Variables: t a type

Question: sizeof(unsigned t) equals
Answer: sizeof(t)
Page: 145
Chapter: 6
Section: 2.7
Variables: t a type

Question: sizeof(signed t) equals
Answer: sizeof(t)
Page: 145
Chapter: 6
Section: 2.7
Variables: t a type

Question: sizeof(char t) equals
Answer: 1
Page: 149
Chapter: 6
Section: 2.7

Question: sizeof(long t)
Answer: is at least sizeof(t)
Page: 149
Chapter: 6
Section: 2.7

Question: sizeof(bool)
Answer: is at most size of long
Page: 149
Chapter: 6
Section: 2.7

Question: sizeof(short)
Answer: is between the size of char and the size of int
Page: 149
Chapter: 6
Section: 2.7

Question: sizeof(wchar_t)
Answer: is between the size of char and the size of long
Page: 149
Chapter: 6
Section: 2.7

Smaller0: sizeof(float)
Greater0: sizeof(double)
Page: 149
Chapter: 6
Section: 2.7
Smaller to greater: \(\le\)
Greater to smaller: \(\ge\)

Question: Number of bit of char
Answer: At least 8
Page: 150
Chapter: 6
Section: 2.7

Question: Number of bit of short
Answer: At least 16
Page: 150
Chapter: 6
Section: 2.7
Context: C++

Question: Number of bit of long
Answer: At least 32
Page: 150
Chapter: 6
Section: 2.7

Instruction: alignment_of<X>
Page: 150
Language: C++
Chapter: 6
Section: 2.9
Returns: The alignment of expr
Abbreviation: alignof(expr)

Typ: alignas(t)
Meaning: A type which align as t
Page: 151
Language: C++
Chapter: 6
Section: 2.9
Variables: t a type