If I initialized a 2d array let’s say
Int a[2][3] = {
1, 2, 3,
4, 5, 6};
Is a[0] == &a[0]??
I know a[0] refers to the address for the first element of the array. So is &a[0] still the address?
First of all, the type of
arrayNum[0]isInt[3]and the type of&arrayNum[0]isInt(*)[3](I didn't change the OP'sIntto the probableint).Secondly, arrays can decay to a pointer to its first element, so
arrayNum[0]can decay to&arrayNum[0][0]which is of typeInt*.Both those pointers,
&arrayNum[0]and&arrayNum[0][0]will point to the same location, but their types are very different.