C - 'char **' differs in levels of indirection from 'char (*)[6]'

前端 未结 3 1184
说谎
说谎 2021-01-02 01:31

Can someone please explain to me what\'s wrong with the following, and more importantly why?

int main( int argc, char *argv[] )
{
    char array[] = \"array\         


        
3条回答
  •  忘掉有多难
    2021-01-02 01:52

    char **test; is a pointer to a pointer, but if you're going to take the address of an entire array then it needs to be a pointer to entire array i.e char (*test)[6];

提交回复
热议问题