[prev] [index] [next]

Dynamic Memory Allocation (cont)

Fixed-size memory allocation:
  • allocate as much space as we might ever possibly need
Dynamic memory allocation:
  • allocate as much space as we actually need
  • determine size based on inputs
But how to do this in C?
  • all data allocation methods so far are "static"
  • however, stack data (when calling a function) is created dynamically  (size is known)