Fundamental Data Types Flashcards

1
Q

Smallest unit of memory

A

binary digit, known as a bit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Smallest amount of memory that can be addressed directly

A

a byte

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

sizeof

A

can be used to return the size of a type in bytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

signed integers - explain.

2 things to watch out for

A

used for holding positive and negative whole numbers, including 0. The set of values that a specific data type can hold is called its range.

When using integers, keep an eye out for overflow and integer division problems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Unsigned integers

A

only hold positive numbers (and 0), and should generally be avoided unless you’re doing bit-level manipulation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Fixed-width integers

A

are integers with guaranteed sizes, but they may not exist on all architectures.

The fast and least integers are the fastest and smallest integers that are at least some size.

std::int8_t and std::uint8_t should generally be avoided, as they tend to behave like chars instead of integers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

size_t

A

is an unsigned integral type that is used to represent the size or length of objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Floating point precision

A

defines how many significant digits it can represent without information loss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

rounding error

A

when too many significant digits are stored in a floating point number that can’t hold that much precision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

floating point number gotcha

A

don’t compare them directly because of rounding errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly