2020-11-03

学习分享:指针数组

#include<stdio.h>
int main()
{
	int a[] = { 1,2,3 };
	int b[] = { 4,5,6 };
	int c[] = { 7,8,9 };
	int* arr[] = { a,b,c };
	for (int i = 0; i < 3; i++)
	{
		for (int j = 0; j < 3; j++)
		{
			printf(" %d", arr[i][j]);
		}
		printf("\n");
	}
	return 0;
}

(以上代码本人亲测无误)

//指针数组里面的元素都是指针

//指针数组是一个特殊的二维数组模型

//最后一步输出用二维数组打印指针

猜你喜欢

转载自blog.csdn.net/weixin_51476766/article/details/109477884
今日推荐