Pointers - Examples
Example: Swapping two arrays:int a1[10];int a2[10];int *pa1 = a1;int *pa2 = a2;int *temp;/* now pa1[3] = a1[3], for example, and *(pa1+3) = a1[3] */temp = pa1;pa1 = pa2;pa2 = temp;
Another (not elegant) way to implement array assignment pa1=pa2: int j;for (j=0;jj++) *(pa1++) = *(pa2++);