他们不一样.
void (**foo)(int);
foo
是指向函数的指针,该函数接受int
参数并返回void
.
void *(*foo)(int):
foo
是指向函数的指针,该函数接受int
参数并返回指向void
的指针.
后缀运算符(如()
和[]
)的优先级高于一元*
,因此
T *a[N]; // a is an array of pointer to T
T (*a)[N]; // a is a pointer to an array of T
T *f(); // f is a function returning pointer to T
T (*f)(); // f is a pointer to a function returning T