External Data Flashcards

1
Q

What are the variable types in C?

A

Local, global, static

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

What is the scope and lifetime of a static variable?

A

Scope: local to the block of code that declares it
Lifetime: Life of the block of code

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

What is the scope and lifetime of global variables?

A

Scope: global
Lifetime: Life of the program

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

What is the scope and lifetime of static local variables?

A

Scope: Block of code where declared
Lifetime: Life of the program
Persist from call to call of the
function

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

What is the scope and lifetime of static global variables?

A

Scope: local to file
Lifetime: life of program

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

What are the characteristics of the .text section?

A

Contains: Program text(machine code), programmer initialized data
The .text section is read-only memory

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

What is the difference between a global and a static variable?

A

Global variables can be accessed by other files. Static variable are private to where they are declared.

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

What are the characteristics of the .data section

A

Contains: programmer initialized data
The .data section contains read/write memory

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

What are the characteristics of the .bss(block starting by symbol) section?

A

Contains: zero-initialized data
The .bss section is read/write memory.
Located in low memory, just after section reserved for OS kernel.

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

What data section are constants stored into?

A

.text section

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

(T/F) .bss section only used the .skip pseudo-op

A

True

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

What are the 2 ways to denote character constants?

A

Character can be denoted with their hex code(ASCII) or by the character in single quotes

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

(T/F) A string literal is a read-only array of characters, allocated in the text section

A

True

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