给定程序中,函数fun的功能是将形参std所指结构体数组中年龄最大者的数据作为函数值返回,并在rruun函数中输出。 #include typedef struct { char name[10]; int age; }

admin2016-12-25  20

问题 给定程序中,函数fun的功能是将形参std所指结构体数组中年龄最大者的数据作为函数值返回,并在rruun函数中输出。
  #include
  typedef struct
    { char  name[10];
    int age;
    } STD;
  STD fun( STD std[],int n)
    { STD max,int i;
    max=________;    /*第一空*/
    for(i=1;i    i(max.age<________)max=std;/*第二空*/
    retum max;
    }
    main()
    { STD std[5]={"aaa",17,"bbb",16,"ccc",18,"ddd",17,"eee",15};
    STD max,
    max=fun( std,5);
    printf( "\n the result:\n");
    printf( "\nName:% s,Age:% d\n",________,max.age);  /*第三空*/
    }

选项

答案8td[0] 8td[i].age max.name

解析
转载请注明原文地址:https://kaotiyun.com/show/MjAx777K
0

相关试题推荐
最新回复(0)