How do you decipher complex declarations of pointers+arrays?

后端 未结 7 1581
醉话见心
醉话见心 2021-02-06 17:08

Although I use std::vector almost all the time, I am interested in understanding as much as I can about pointers. Examples of what I am talking about:



        
7条回答
  •  野性不改
    2021-02-06 17:51

    cdecl is a program which is nice for this sort of thing. (particularly when you add function pointers into the mix!)

    Type `help' or `?' for help
    cdecl> explain char* foo[5]
    declare foo as array 5 of pointer to char
    cdecl> declare bar as array 5 of pointer to function (integer, integer) returning char
    char (*bar[5])(int , int )
    

提交回复
热议问题