结构体初始化

来源:互联网 发布:柯尔特蟒蛇357淘宝模型 编辑:程序博客网 时间:2024/06/08 09:08
#include <stdio.h>


struct Student
{
int num;
int age;
char name[20];
};


struct Student stu = {
.num = 12,
.age = 324,
.name = "cpp",
};


int main()
{
printf("%d\t\%d\t%s\n", stu.num, stu.age, stu.name);


return 0;
}
原创粉丝点击