Week 2 - Memory Layout of a C Program Flashcards
1
Q
What are the 4 sections of a C program?
A
Code segment
Data Segment
Stack
Heap
2
Q
What is in the code segment of a c program?
A
The executable instructions
3
Q
What is in the data segment of a c program?
A
initialised and unitialised global and static variables
4
Q
What is in the stack of a c program?
A
local variables (includes arguments passed to a function)
5
Q
What is in the heap of a c program?
A
Dynamically allocated variables