Programming - Arrays & Pointers(8)


Administrivia

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


Crystal Balls


Arrays


Initialization


Simple array


random number generator


dice.c


The nature of memory


Addresses


It's like a treasure hunt


Just more numbers


Data types


Declaring a pointer


The address-of (&) operator


Example


Example


The contents-of (*) operator


Example


Example


Example


Example


Example


Example


Example


Example


Example


Example


Operations on pointers


Pointer assignment


Pointer dereferencing


The address-of operator (&)


NULL


Changes to parameters don't "pass back"


Example


Example


Example


Example


Example


Example


Example


Example


Example


Scope


Extent


Scope vs. Extent


swap() again


Extent of tmp


Extent of i and j


Extent is important!


practices prev top next
Maintained by Efi Fogel. Last modified: December 22 2003.