Regarding pointers

for
int a[]={1,2,3,4};
cout<<a;
cout<<&a shows same output;
cout<<a should show the value inside pointer a
and cout<<&a should show the address of a

Hello @Namanjain123,

As you have been taught that the name of an array acts as a pointer to its first element.
So, cout<<a; is printing the address of a[0].

Also, printing the address of an array is printing the starting address of the array i.e. a[0].
So, cout<<&a; prints the address of the array.

Hence, both the outputs are the same.

Hope, this would help.
Give a like, if you are satisfied.