For example, I have this declaration :
int a[10];
Before, I understood it like this: a in fact is a pointer, and it will point to 10 elements consecutively in memory.
But today, when my teacher taught me, he said: it will be an array of pointers, and each pointer points to its value.
I don’t know which is true. please tell me.
This is wrong, it is an array. It has a specific location in the memory and can hold 10 integers. With a pointer you can do
a = &some_int, however, this does not work for arrays. If you passato a function that is expecting a pointer, it will be decayed (converted into) a pointer but this is different.This is also wrong, it is an array of 10 integers. To have 10 integer pointers, you need to define it as
int *a[10]. Still elements do not point to their values.