一、概念
二、代码
#include <stdio.h>
int main()
{
char name1[] = "lyh";
char name2[] = "lys";
char name3[] = "lyx";
char name4[] = "lyt";
// 如果想存储一堆字符串 那么可以使用字符串数组
// 说白了 字符串数组 就是二维数组
char names[4][20] =
{
"lyh",
"lys",
"lyx",
"lyt"
};
char names2[4][20] =
{
{'l','y','h','\0'},
{'l','y','s','\0'},
{'l','y','x','\0'},
{'l','y','t','\0'},
};
return 0;
}