C语言复杂声明

C语言复杂声明

First step

int *f();

/* f:是一个函数,它返回一个指向int类型的指针*/

int (*pf)();

/* pf:是一个指向函数的指针,该函数返回一个int类型的对象*/

说明:*是一个前缀运算符,其优先级低于()

Deeper

char **argv

argv : pointer to pointer to char

指向char 类型的指针的指针

int (*daytab)[13]

daytab:pointer to array[13] of int

daytab:指向int类数组的指针

int *daytab[13]

daytab: array[13] of pointer to int

int类指针的数组

void *comp()

comp:function returning pointer to void

返回void类的指针的函数

void (*comp)()

comp:pointer to function returning void

comp:指向返回void类的函数的指针

char (*(*x())[])()

x: function returning pointer to array[] of pointer to function returning char

x()返回一个指向数组的指针,该数组中包含了指向返回char类型的函数的指针

char (*(*x[3])())[5]

x:array[3] of pointer to function returning pointer to array[5] of char

x[3]数组里面存放指向函数的指针,该函数返回的是指向char类型的数组[5]

原文地址:https://www.cnblogs.com/sylvialucy/p/4854035.html