请考虑以下代码
#include <stdio.h>
#define ROW_SIZE 2
#define COL_SIZE 2
int main()
{
int a[ROW_SIZE][COL_SIZE]={{1,2},{3,4}};
// Base address:Pointer to the first element a 1D array
printf("Base address of array:%p\n",a);
//The value at the base address: should be the address of 1st 1D array
printf("Value at the Base address:%p\n",*a);
return 0;
}
获得的输出:
Sample Output:
Base address of array:0xbff77434
Value at the Base address:0xbff77434
不知何故,我无法理解二维数组的基地址的概念和基地址的值,而基地址又是一维数组的地址。请解释。