array of N pointers to functions returning pointers to functions

后端 未结 6 1725
时光说笑
时光说笑 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:45

    Is this what you are looking for:

    typedef char* charptr;
    typedef charptr (*innerfun)();
    typedef innerfun (*outerfun)();
    
    const size_t N = 10;
    outerfun my_outerfun_array[N];
    

    I hope I got it correct, it seems a strange question to me especially in an interview :(

提交回复
热议问题