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

来源:4-2 定制自己的容器:结构体和共用体

qq_慕函数7298766

2021-05-29 18:18

#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;

}


写回答 关注

2回答

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

    感谢哦😘

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

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

趣味 C++ 入门

C++ 入门,开启趣味学习之旅,揭开 C++ 的神秘面纱,让你不再望而生畏。

31200 学习 · 189 问题

查看课程

相似问题