External Data Flashcards
What are the variable types in C?
Local, global, static
What is the scope and lifetime of a static variable?
Scope: local to the block of code that declares it
Lifetime: Life of the block of code
What is the scope and lifetime of global variables?
Scope: global
Lifetime: Life of the program
What is the scope and lifetime of static local variables?
Scope: Block of code where declared
Lifetime: Life of the program
Persist from call to call of the
function
What is the scope and lifetime of static global variables?
Scope: local to file
Lifetime: life of program
What are the characteristics of the .text section?
Contains: Program text(machine code), programmer initialized data
The .text section is read-only memory
What is the difference between a global and a static variable?
Global variables can be accessed by other files. Static variable are private to where they are declared.
What are the characteristics of the .data section
Contains: programmer initialized data
The .data section contains read/write memory
What are the characteristics of the .bss(block starting by symbol) section?
Contains: zero-initialized data
The .bss section is read/write memory.
Located in low memory, just after section reserved for OS kernel.
What data section are constants stored into?
.text section
(T/F) .bss section only used the .skip pseudo-op
True
What are the 2 ways to denote character constants?
Character can be denoted with their hex code(ASCII) or by the character in single quotes
(T/F) A string literal is a read-only array of characters, allocated in the text section
True