我学习C语言,我很难理解指针和数组. 在我阅读的教程中,我有这一行: char* arrP1[] = { "father","mother",NULL }; 我的问题是什么是arrP1? 它是指向静态字符串的指针数组: 或者它是指向字符串
          在我阅读的教程中,我有这一行:
char* arrP1[] = { "father","mother",NULL }; 
 我的问题是什么是arrP1?
它是指向静态字符串的指针数组:
或者它是指向字符串数组的指针:
我很困惑……什么是arrP1?
要找到这些问题的答案,你可以使用 cdecl.它很可能会回答你.declare arrP1 as array of pointer to char
但是,有一个被称为spiral rule的东西.它也可以帮助你阅读decleration.例如,
char *str[10]
         +-------+
         | +-+   |
         | ^ |   |
    char *str[10];
     ^   ^   |   |
     |   +---+   |
     +-----------+
-   str is an array of 10 elements
-   str is an array of 10, of pointers
-   str is an array of 10, of pointers, of type char
        
             