From my lecture slides it says:
As shown in the code below, the array name can be assigned to the corresponding pointer without the need for the previous and operator.
int x;
int a[3] = {0,1,2};
int *pa = a;
x = *pa;
x = *(pa + 1);
x = *(pa + 2);
a += 2; /* invalid */
Why is it a += 2;invalid?
Can anyone help clarify?
Also feel free to edit the title if you are thinking of the best.
source
share