正在加载图片...
(3)数组元素不能整体输入输出,只能单个成员输入输出。 例# Include“ stdio include“ stdlib-h struct stud_type I char name[10] long num; int age; char sex; float score; maino i struct stud_ type student3] int if char ch, numstr[20 for (=0;i<3;i++) i printf(student%dn",i)B getsstudent[ i ]. name); gets(numstristudent[ i ]. num=atol(numstr);(3)数组元素不能整体输入输出,只能单个成员输入输出。 例 #include “stdio.h” #include “stdlib.h” struct stud_type { char name[10] long num; int age; char sex; float score; }; main() { struct stud_type student[3]; int i; char ch,numstr[20]; for (i=0;i<3;i++) { printf(“student[%d]:\n”,i); gets(student[ i ].name); gets(numstr);student[ i ].num=atol(numstr);
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有