结构体与联合

1 struct +结构体名 +{成员表列}; 比如:struct student { char name[32]; //不能写成char name[32]={0} int age; char sex; }; 2 定义结构体变量:struct student s1; 3 初始化结构体变量:struct student s2 ={“aaa”, 21, ‘m’}; 4 打印结构体变量(逐个打印):pr
相关文章
相关标签/搜索