简体   繁体   中英

Understanding c function pointers

Statement:

"array of N pointers to functions, returning pointers to functions and returning pointer to integer"

Can anyone help me with understanding the function prototype for above statement ?

Given answer- int *(*(*a[N])()) ();

Please can anyone explain me how we arrive at the above answer ?

*a[N]

is the array of N pointers, calling it x

*(x)()

returning function pointer, calling it y

int *(y) ()

is function pointer returning integer

int *(*(*a[500])()) ();

Translates to:

declare a as array 500 of pointer to function returning pointer to function returning pointer to int


Note:Next time, use this site to understand complex pointer statements http://cdecl.org/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM