//字符串数组
//字符串数组
//需求:定义一个数组存储5个学生的姓名进行遍历
#include<stdio.h>
int main()
{
char arr[5][100] = {
"张三",
"李四",
"王五",
"赵六",
"钱七"
};
for (int i = 0; i < 5; i++)
{
char str1 = arr[i];
printf("%s\n", str1);
}
printf("-------------------\n");
//指针数组方式遍历
char* strArr[5] = {
"张三",
"李四",
"王五",
"赵六",
"钱七"
};
for (int i = 0; i < 5; i++)
{
char* str2 = strArr[i];
printf("%s\n", str2);
}
return 0;
}