#include <stdio.h> #include <stdlib.h> int main(){ char str[][30] = {"zhangsan","lisi","wangwu"}; char (*p)[30] = str; //定义行指针 printf("%p %p %p 行数:%d 列数:%d\n",str, &str[0], &str[0][0], sizeof(str)/sizeof(str[0]),sizeof(str[0])/sizeof(str[0][0])); //行数 = sizeof(array)/sizeof(array[0]); //列数 = sizeof(array[0])/sizeof(array[0][0]); int i; for(i=0;i<sizeof(str)/sizeof(str[0]);i++){ printf("%s \n",*(p+i)); } return 0; }