实际上C的二维数组其实就是字符串数组例如
char name[2][5] = {"abc","def"};
--> char name[2][5] = {
{
'a','b','c','\0'
},
{
'd','e','f','\0';
}
};
char name[2][5] = {"abc","def"};
printf("%s",name[0]); // 结果: abc
putchar('\n');
printf("%s",name[1]); // 结果: def
putchar('\n');
printf("%c",name[0][1]); //结果 b;
putchar('\n');