问答详情
源自:4-2 定制自己的容器:结构体和共用体

结构体要加上;程序才不会出错

#include<stdio.h>

#include<iostream>

struct Student

{

    int math;

    int english;

};

int main(int argc,char **argv)

{

    struct Student stu[50];


    //其中一个学号为:21的学生成绩赋值

    stu[20].math = 100;

    stu[20].english = 98;

}


提问者:qq_慕函数7298766 2021-05-29 18:18

个回答

  • weixin_慕桂英6204820
    2023-02-25 09:40:26

    感谢哦😘

  • 室兰
    2021-07-21 16:00:55

    感谢。struct要加分号。记住了。