二维数组
#include <stdio.h> #include <stdlib.h> int main() { int age[2][4] = { 1,2,3,4,5,6,7,8 }; int* p = &(age[0][0]); int i = 0; int j = 0; for (i = 0; i < 2; i++) { for (j = 0; j < 4; j++) { printf("age[%d][%d] %p %d\n", i, j, &(age[i][j]), *(p + i * 4 + j)); } } system("pause"); return 0; }
时间: 2024-12-19 23:00:05