Monday, May 16, 2011

5.1 Pointers and Addresses

  • A typical machine has an array of consecutively numbered or addressed memory cells that may be manipulated individually or in contiguous groups
  • The unary operator & gives the address of an object
  • & operator only applies to objects in memory: variables and array elements
  • The unary operator * is the indirection or dereferencing operator; when applied to a pointer, it accesses the object the pointer points to
  • Example:

No comments:

Post a Comment