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

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

What is in the code segment of a c program?

A

The executable instructions

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

What is in the data segment of a c program?

A

initialised and unitialised global and static variables

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

What is in the stack of a c program?

A

local variables (includes arguments passed to a function)

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

What is in the heap of a c program?

A

Dynamically allocated variables

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