• 2021-04-14
    下面程序的运行结果是: 。 typedef union student{ char name[10]; long sno; char sex; float score[4]; }STU; main(){ STU a[5]; printf("%d",sizeof(a)); }
  • 80

    内容

    • 0

      以下对结构体类型的变量定义中不正确的是 。 A: B: define STUD struct student STUD {long num; char name[20]; char sex; float score;}; STUD stud1,stud2; C: struct student {long num; char name[20]; char sex; float score; }stud1,stud2; D: struct {long num; char name[20]; char sex; float score; } stud1,stud2; E: struct {long num; char name[20]; char sex; float score; }student;struct student stud1,stud2;

    • 1

      有以下程序段,输出结果为()。#include<stdio.h>struct student{int num;char name&#91;20&#93;;float score;};main(){struct student stu&#91;5&#93;;printf("%d",sizeof(stu));} A: 140 B: 160 C: 5 D: 随机值

    • 2

      设有以下程序片段,则下面的叙述不正确的是( ) struct student { int num; char name[10]; float score; }stu;

    • 3

      以下结构体的定义语句中,正确的是______。? struct student {int num; char name[10];int age;}stu;|struct {int num; char name[10];int age;}student; struct student stu;|struct student {int num; char name[10]; int age;}; student stu;|struct student {int num; char name[10];int age;};stu;

    • 4

      有以下程序 struct STU { char num[10]; float score[3]; } main() { struct STU s[3]={{"20021",90,95,85},{"20022",95,80,75}, {"20023",100,95,90}},*p=s; int i; float sum=0; for(i=0;i<3;i++) sum=sum+p->score[i]; printf("%6.2f\n",sum); } 程序运行后的输出结果是