I learnt that just the array name by itself has the value of the address of the first element of that array. Example, int num[] ={1,2,3}; so num has the value of &num[0] and a separate address. However, when I try finding the address for this num, it gives me the same address as &num[0]. Aren't they supposed to have different addresses num and &num[0].
int main(){
int num[4]={1,2,3,4};
int* int_ptr = num;
printf("%d\n", &num[0]);
printf("%d\n", num);
printf("%d\n", &num);
printf("%d", int_ptr);
}
My output is:
6422268
6422268
6422268
6422268