c99标准允许对某一成员初始化,如;
struct Student b={.name=“Zhang Fang”};
比如说
程序代码:#include<stdio.h>
struct student
{char name[12];
int age;
};
struct student stu1={.name="Zhang Fang"};
int main()
{printf("%s\n",stu1.name);
return 0;
}
编译后提示:error C2059: syntax error : '.'







