在主函数中的二维数组s[3][7]也用指针表达,输出的时就不会出现乱码,而能正确运行了:程序如下:#include<stdio.h>#include<stdlib.h>voidlongestCommonPrefix(char**strs){inti,j;for(i=0;i<3;i++){for(j=0;j<7;j++)printf("%c",strs[i][j]);printf("\n");}}intmain(){char**s[]={"flower","flow11","flight"};longestCommonPrefix(s);getch();return0;}