C语言常见的复杂类型整理

int *p; --> 指针
int arr[5]; --> 数组
int *p[5]; --> 指针数组
int (*p)[5]; --> 数组指针
int *((*p)[5]); --> 指针数组的指针
int *((*p)[10])[5]; --> 指针数组指针的数组
int (*p[10])[5]; --> 数组指针数组
int *(*p[5])[5]; --> 数组指针数组的指针


int test() --> 函数的声明

int (*ptest)() --> 函数指针 

(void (*)() 函数指针 --> void(*)()0 将0强转为函数指针 -->
(void(*)()0) 对0这个函数指针解引用 --> (*(void(*)()0)() -->
调用函数,这个函数为:无返回类型参数为空的函数

void(*signal(int,void(*)(int)))(int);

typedef void(*pfun_t)(int); -->定义了一个 函数指针类型
返回值为void 参数为int 的函数指针类型

pfun_t signal(int, pfun_t) --> 返回值为 函数指针 参数为 int和函数指针 的函数声明

int (*p[5])() -->函数指针数组
int *p[5]() --> 不存在这样的东西
int (*)()p[5] -->错误的,语法错误

int ((*p)[5])() -->数组指针函数
int (*(*p)[5])() -->函数指针数组指针
int (*(*p[10])[5])() -->函数指针数组指针的数组

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值