1葬项,習(xí)題講解掂咒;
2腥寇,結(jié)構(gòu)體:struct? student?先聲明再定義
struct? student ????????//(聲明)
{
int?num;
char?name[10];
float?score[2];
}
(1)定義單個(gè):struct?student?xx[2]={1氮惯,"yi"组底,95.5,84.5};
(2)定義數(shù)組:struct?student?xx[2]={1筐骇,"yi",95.5,84.5,2江滨,"er"铛纬,99.6,35.4,}唬滑;
3告唆,結(jié)構(gòu)體輸出形式;
printf ("%d? %s? %f",xx[i].num,xx[i].name,xx[i].score[0],xx[i].score[1]);