Computer Programming (8) - Pointers


administrivia

Web Page - http://www.cs.tau.ac.il/~efif/courses/ComputerProgramming


the nature of memory


sequential numbering


addresses


it�s like a treasure hunt�


what�s the point?


just more numbers


data types


declaring a pointer


the address-of (&) operator


example


example


the contents-of (*) operator


example


example


example


example


confusion


confusion


example


example


example


example


example


example


example


operations on pointers


pointer assignment


pointer dereferencing


address-of operator (&)


remember�


remember�


NULL


pointers and function arguments


how did I lie?


example


but�


example


example � what�s going on here?


example � what�s going on here?


example � what�s going on here?


example � what�s going on here?


example � what�s going on here?


example � what�s going on here?


example � what�s going on here?


example � what�s going on here?


so what does all that mean?


scope


extent


extent


scope vs. extent


variable lifetime


variable extent


swap() again


extent of tmp


extent of i and j


so what?


returning a pointer

lectures prev top next
Maintained by Efi Fogel. Last modified: January 25 2003.