[prev] 29 [next]

The C View of Data (cont)

Variables are examples of computational objects

Each computational object has

  • a location in memory (obtainable via &)
  • a value   (ultimately just a bit-string)
  • a name   (unless created by malloc())
  • a type, which determines ...
    • its size   (in units of whole bytes, sizeof)
    • how to interpret its value; what operations apply
  • a scope   (where it's visible within the program)
  • a lifetime   (during which part of program execution it exists)