Rule for indexing arrays and pointers
•int array[10];
•int *pElement;
•
•pElement = array;
•
•array[i] = 0;
•pElement[i] = 0;
•
•Why?
•
•*(array+i) = 0;
•*(pElement+i) = 0;
•
•Consequence:
•
•i[array] = 0; // OK
•i[pElement] = 0; // OK