结构体名字

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

慕函数7131464

2022-11-13 15:43

结构体名字是这样命名吗?

struct student{

int math;

int english;

};

student就是名字,后面用的话不是应该student.math[]吗?

写回答 关注

1回答

  • 慕函数7131464
    2022-11-13 15:44:40

    int main(){

       struct Student stu[50];

       stu[20].math=50;

       stu[20].english=50;

       return 0;

    }


    里的 struct Student stu[50];是重新命名为stu了吗


趣味 C++ 入门

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

31202 学习 · 189 问题

查看课程

相似问题