C Data Types Flashcards

1
Q

int

A

Data Type

Stores a regular integer, defaulting to 32 bits in size

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

double

A

Data Type

Holds a large floating point number

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

char

A

Data Type

Holds a single 1 byte character

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

void

A

Data Type

Indicates “no type” and used to say a function returns nothing, or a pointer has no type as in void *thing.

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

enum

A

Data Type

Enumerated types, work as integers, convert to integers but give you symbolic names for sets. Some compilers will warn you when you don’t cover all elements of an enum in switch-statements

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

unsigned

A

Type Modifier

Changes the type so that it does not have negative numbers, giving you a larger upper bound but nothing lower than zero.

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

signed

A

Type Modifier

Gives you negative and positive numbers but halves your upper bound in exchange for the same lower bound negative.

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

long

A

Type Modifier

Uses a larger storage for the type so that it can hold bigger numbers, usually doubling the current size.

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

short

A

Type Modifier

Uses smaller storage for the type so it stores less, but takes half the space.

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

const

A

Type Qualifier

Indicates the variable won’t change after being initialized.

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

volatile

A

Type Qualifier

Indicates that all bets are off, and the compiler should leave this alone and try not to do any fancy optimizationis to it. You usually only need this if you’re doing really weird stuff to your variables.

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

register

A

Type Qualifier

Forces the compiler ot keep this variable in a regestier, and the compiler can just ignore you. These days compilers are better at figuring out where to put variables, so only use this if you actually can measure it improving the speed.

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

int8_t

A

Type Size

defined in stdint.h

8 bit signed integer

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

uint8_t

A

Type Size

  • defined in stdint.h*

8 bit unsigned integer

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

int16_t

A

Type Size

defined in stdint.h

16 bit signed integer

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

uint16_t

A

**Type Size **

defined in stdint.h

16 bit unsigned integer

17
Q

int32_t

A

Type Size

defined in stdint.h

32 bit signed integer

18
Q

uint32_t

A

Type Size

defined in stdint.h

32 bit unsigned integer

19
Q

int64_t

A

Type Size

defined in stdint.h

64 bit signed integer

20
Q

uint64_t

A

**Type Size **

defined in stdint.h

64 bit unsigned integer

21
Q

INTN_MAX

A

**Type Size **

defined in stdint.h

Maximum positive number of the signed integer of bits N.

22
Q

INTN_MIN

A

Type Size

defined in stdint.h

Minimum negative number of the signed integer of bits N.

23
Q

UINTN_MAX

A

**Type Size **

defined in stdint.h

Maximum positive number of unsigned integer of bits N. Since it’s unsigned the minimum is 0 and can’t have a negative value.

24
Q

int_leastN_t

A

Type Size

defined in stdint.h

holds at least N bits.

25
Q

uint_leastN_t

A

Type Size

defined in stdint.h

holds at least N bits unsigned.