Difficulty in understanding

int a[4];

Declares an array of integers of size 4

a is a pointer to the base element of the array

So my question is, does a also occupies a memory as a pointer, different than the memory occupied by the array?
a is a pointer to the base element of the array

No, a is an array of int with 4 elements, which you should answer your question.
However, an array can be implicitly converted into a pointer to its first element.
What does this mean: an array can be implicitly converted into a pointer to its first element
It means that you can do the following:

1
2
3
int a[4];
int* b=a;
int* e=a+4;
Sameer Implicit Conversion means that the Compiler converts type to another automatically :) But this has rules :)
Topic archived. No new replies allowed.