这样也可以
另外,不要纠结这类问题了
p是一个数组,有7个元素,每一个元素都是一个指针,这个指针指向一个数组,指向的这个数组有5个元素,每一个元素都是一个指针,这个指针指向char
#include <stdio.h>
int main(void)
{
char *line1[5] = {"########","####"," ###### ","## ##"," ###### "};
char *line2[5] = {"## "," ## ","## ##","## ##","## ##"};
char *line3[5] = {"## "," ## ","## ","## ##","## "};
char *line4[5] = {"###### "," ## "," ###### ","#########","## "};
char *line5[5] = {"## "," ## "," ##","## ##","## "};
char *line6[5] = {"## "," ## ","## ##","## ##","## ##"};
char *line7[5] = {"## ","####"," ###### ","## ##"," ###### "};
char *(*p[7])[5] = {&line1, &line2, &line3, &line4, &line5, &line6, &line7};
printf("%s\n", (*p[0])[0]);
return 0;
}
|