利用例题直接阐释:
#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> struct hobby//hobby:爱好 { char color[10]; char sports[10]; }; struct stu { char name[10]; int age; struct hobby s2; double height; }; int main() { struct stu s1 = { "阿跃",20,{"blue","basketball"},173.5 }; //struct stu s1 = { "阿跃",20,173.5 }; printf("%s,%d,%lf\n", s1.name, s1.age, s1.height); printf("%s", s1.s2.color); return 0; }
标签:初始化,语言,10,s1,42,char,stu,hobby,struct From: https://www.cnblogs.com/ayue6/p/17802633.html