一、概念
二、代碼
#include <stdio.h>
int main()
{
char name1[] = "lyh";
char name2[] = "lys";
char name3[] = "lyx";
char name4[] = "lyt";
// 如果想存儲一堆字符串 那么可以使用字符串數(shù)組
// 說白了 字符串數(shù)組 就是二維數(shù)組
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;
}