next up previous
Next: About this document ... Up: Pointers Previous: Pointers to a struct

Pointer Arithmetic


int array[4] = { 1,4,9,16};
int* arrayp;

arrayp = array;
cout << *arrayp    << endl;
cout << arrayp[1] << endl;
arrayp += 2;
cout << *arrayp  << endl;


Andreas Koeller
2000-06-04