pragma mark 指针数组
pragma mark 概念
pragma mark 代码
#include <stdio.h>
int main()
{
#warning 字符串 二维数组
/*
char str[] = "lyh";
char str1[] = "lys";
char str2[] = "lyx";
char str3[] = "lyt";
char strs[4][20] =
{
"lyh",
"lys",
"lyx",
"lyt"
};
*/
#warning 指针数组
char *str1 = "lyh";
char *str2 = "lys";
char *str3 = "lyx";
char *str4 = "lyt";
// 定义数组的格式 : 元素类型 数组名称[元素个数]
// int a = 10;
// int b = 20;
// int nums[2] = {10, 20};
char *names[4] =
{
"lyh",
"lys",
"lyx",
"lyt"
};
for (int i = 0; i < 4 ; i++) {
printf("names[%i] = %s\n",i,names[i]);
}
return 0;
}