#include <stdio.h>
#include <string.h>
main()
{
struct aa
{
int a;
char b[15];
}bb;
bb.a = 15;
//bb.b = "abcde";
strcpy(bb.b,"abcde");
printf("%d\n",bb.a);
printf("%s\n",bb.b);
}
结果
15
abcde
注释的bb.b = “abcde”; 错误 不合法 bb.b是数组名 地址 是常量 不能赋值