array of N pointers to functions returning pointers to functions

后端 未结 6 1632
时光说笑
时光说笑 2021-02-02 14:57

This was asked to me in an interview! i really got confused

  • How do I declare an array of N pointers to functions returning pointers to functions returning pointers
6条回答
  •  借酒劲吻你
    2021-02-02 15:24

    Using typedefs as Christopher tells you is really th only humane way of declaring such a thing. Without tyedefs , it'll become:

    char *(*(*arr[10])(void ))(void );
    

    (yes I had to cheat and ran cdecl> declare arr as array 10 of pointer to function(void) returning pointer to function(void) returning pointer to char )

提交回复
热议问题