Ch3: Pointers and Memory Flashcards

(5 cards)

1
Q

What are the 4 main segments in the C memory model

A
  • code
  • data
  • heap
  • stack
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the code segment store

A
  • program instructions
  • addresses of functions
  • sometimes string literals
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the data segment store

A
  • global variables
  • static variables and constants
  • fixed strings (literals)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the stack segment store

A
  • manages order of function calls (parameters, return addresses)
  • local variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the heap segment store

A
  • manages dynamically-allocated memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly