結構體與聯合

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
相關文章
相關標籤/搜索