4
int A;
int* pA = 1;
int Vect[2] = {1,2};
int* pVect;
pA = &A;
*pA = 2;
pVect = Vect;
pVect[0] = 10;
In the case I have a pointer to a variable and then to an array, and I want to change its values by pointer. Why is there this divergence in passing addresses (in the variable I have to use the &
and the vector does not need)? This is typical of the C language?
From what I know of pointer, it points to the memory address of that variable obtained by &
, but for vector does not need the &
.