C语言二维数组与指针的关系

#include "stdio.h"

int main()
{
	int a[3][5] = {{1,2,3,4,5},{6,7,8,9,10},{11,12,13,14,15}};

	printf("a[0][0]=%d\n", a[0][0]);
	printf("*a[0]=%d\n", *a[0]);
	printf("**a=%d\n", **a);
	printf("\n");

	printf("a[1][0]=%d\n", a[1][0]);
	printf("*a[1]=%d\n", *a[1]);
	printf("**(a+1)=%d\n", **(a+1));
	printf("\n");

	printf("a[2][1]=%d\n", a[2][1]);
	printf("*(a[2]+1)=%d\n", *(a[2]+1));
	printf("*(*(a+2)+1)=%d\n", *(*(a+2)+1));
	printf("\n");

	return 0;
}

运行结果:
C语言二维数组与指针的关系_第1张图片

你可能感兴趣的:(二维数组,C语言,指针)