I have learned that we can use the address of elements of an array at index i as &A[i]
or simply as A+i
and to get the value
A[i]
or *(A+i)
where A
is an array and i
denotes the Index.
Let's say int A[]={1,2,3};
When I use sizeof(*A)
I get value 4
, now when I use sizeof(A)
I must get the size of address value
of the first element why I get the size of the whole array as 12
.
I am a beginner and confused, please guide.