#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; }