C - Intricacies of Data Types Flashcards

(8 cards)

1
Q

What are the four basic arithmetic type specifiers?

A

char, int, float, and double

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

What are the four modifiers for type specifiers?

A

signed, unsigned, short, and long

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

What is the size of a char?

A

1 byte (8 bits)

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

What type is a char?

A

Characters are integer types. They’re stored as numbers using encoding standards such as ASCII and Unicode.

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

What is the range of a char / signed char?

A

Atleast [-127, +127]

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

What is the range of an unsigned char?

A

Atleast [0, +255]

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

How do you declare strings?

A

You declare the strings the same as an array.
Example (string literal, implicit length): char myString[] = “String”;
Example 2 (string literal, explicit length): char myString[9] = “String”;
Example 3 (implicit length): char myString[] = {‘S’, ‘t’, ‘r’, ‘i’, ‘n’, ‘g’};
Example 4 (explicit length): char myString[9] = {‘S’, ‘t’, ‘r’, ‘i’, ‘n’, ‘g’};

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