/*功能,C++ 複雜聲明() [] 的優先順序高於 *。更多參看以下資料:《C程式設計語言V2cn》p105,5.12,複雜聲明。http://blog.csdn.net/wangweixaut061/article/details/6549768部落格,http://blog.csdn.net/shunqiziranhao007/article/details/8709168日期,2013年3月23日*/#include <iostream>using std::cout; using std::endl;#define P1 cout << endl;#define P2(X) cout << X;#define P3(X) cout << X << endl;template<typename T> void ok(T) {}char* f1(){P3("char* f1()")return 0;}char* f2(){P3("char* f2()")return 0;}typedef char* (*f_t)();f_t f3(){P3("f_t f3()")return f1;}f_t f4(){P3("f_t f4()")return f2;}int main(){char *(*(*a[])())() = {f3, f4};a[0]()();a[1]()();int i;int *pi;int **ppi;int ai[10];int *api[10];int (*pai)[10];// A pointer to a function a that takes an integer argument and returns// an integerint (*fi)(int);// An array of 10 pointers to functions that take an integer argument// and return an integer int (*fai[10])(int);}/*$ ./declare.exe f_t f3()char* f1()f_t f4()char* f2()*/