[prev] 153 [next]

Memory Management (cont)

Given a pointer variable:
  • you can check whether its value is NULL
  • you can (maybe) check that it is an address
  • you cannot check whether it is a valid address
    • dangling pointer … points to an invalid (e.g. deallocated) memory location
    • buffer overflow … trying to access memory beyond allocated block