指向一维数组的指针 char (*p)[10] ;
指向一维数组的指针类型 typedef char(*TYPE_P2ARRAY)[10] ;
该指针可以指向数组 ,且使用起来效果节本相同,但指针与数组并不等价。{sizeof结果不同 , 且该指针还可以指向除此之外其他类型的数据。 }
#include <stdio.h>
typedef int (*TP_PARRY1)[3] ;
#define Uart_Printf printf
void f1(void)
{
int a[2][3] = { {0,1,2},{10,11,12}};
// a : 二维数组名 , equal : 指向一维数组{0,1,2}的指针
TP_PARRY1 p = a;
int (*q)[3] = a;
//int (*t)[2] = a;//warning: initialization from incompatible pointer type
//int** x = a; // CRITICAL ERROR, may lead to Segmentation fault. NO space for PTRs.
//指针结合律:1 (*q)括号最高优先级,表示q是一个指针。
// 2 向右 [] , 表示指向一个数组
// 3 右边没有了,向左,表示该数组的元素是int型。
Uart_Printf("a00:%d\n",a[0][0]);
Uart_Printf("a01:%d\n",a[0][1]);
Uart_Printf("a02:%d\n",a[0][2]);
Uart_Printf("a10:%