L21_pointers - Pointers Pointers Address-Of Operator &...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Pointers Pointers Address-Of Operator & Pointer Variables Indirection (Dereference) Operator * The NULL Pointer new elete EECS 183 University of Michigan Pointers Mary Lou Dorf delete an Inaccessible Object a Dangling Pointer Introduction To Pointers and Dynamic Variables Introduction To Pointers and Dynamic Variables pointer stores a memory address a positive integer or 0 EECS 183 University of Michigan Pointers Mary Lou Dorf 0 is special, a NULL address ("points" to nothing) range of values depends upon the computer you use 0 up through some maximum Legal Operations && Uses Legal Operations && Uses Legal Operations assignment comparison ( == , < , > etc. ) arithmetic: addition and subtraction only ses EECS 183 University of Michigan Pointers Mary Lou Dorf Uses access a memory location via a pointer reference parameters set up dynamic variables and data structures Recall that . . . Recall that . . . char str [ 8 ]; str is the base address of the array. str is a pointer value is an address. str is a pointer constant the value of str cannot be changed by assignment. str points to the memory location of a char . EECS 183 University of Michigan Pointers Mary Lou Dorf str [0] [1] [2] [3] [4] [5] [6] [7] H e l l o \0 6000 Different Views Different Views two representations same thing tr ] [1] [2] [3] [4] [5] [6] [7] H e l l o \0 6000 EECS 183 University of Michigan Pointers Mary Lou Dorf str [0] [1] [2] [3] [4] [5] [6] [7] [0] [1] [2] [3] [4] [5] [6] [7] H e l l o \0 str 6000 Addresses in Memory Addresses in Memory when a variable is declared, enough memory to hold a value of that type is allocated for it at an unused memory location....
View Full Document

This note was uploaded on 02/12/2010 for the course EECS 183 taught by Professor Dorf during the Fall '08 term at University of Michigan.

Page1 / 25

L21_pointers - Pointers Pointers Address-Of Operator &...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online