2011-02-06 33 views
3
int *(*(*P)[2][2])(int,int); 

P是一個指向2x2數組指針的指針,它帶有2個int類型的參數,返回一個int類型的指針。它是否正確?我是對的嗎? - C表達式

+0

這就是爲什麼我喜歡代表haha – 2011-02-06 19:21:50

+0

沒有在測試;-) – Batman 2011-02-06 19:36:50

回答

16

cdecl是搞清楚這些類型的問題了一個偉大的工具:

$ cdecl 
Type `help' or `?' for help 
cdecl> explain int *(*(*P)[2][2])(int,int); 
declare P as pointer to array 2 of array 2 of pointer to function (int, int) returning pointer to int 

所以,是的,你是正確的。