#include<iostream>\n#include<string>\n#include<vector>\nusing namespace std;\nclass Course\n{\n public:\n string name;\n string instructorInCharge;\n int numberOfStudents;\n int totalMarks;\n Course(string u, string v, int p, int q){\n this->name=u;\n this->instructorInCharge=v;\n this->numberOfStudents=p;\n this->totalMarks=q;\n\n }\n \n vector<int> studentMarks (numberOfStudents);\n\n \n\n};\nclass Labs:public Course\n{\n \n vector<int>labMarks(numberOfStudents);\n\n};\n\nint main()\n{\n Course c("Rahul","Hota",200,300);\n cout<<"hello there";\n}\nRun Code Online (Sandbox Code Playgroud)\n当我编译此代码时,我\xe2\x80\x99m 收到以下错误:
\n1.cpp:20:31: error: 'numberOfStudents' is not a type\n 20 | vector<int> studentMarks (numberOfStudents);\n | ^~~~~~~~~~~~~~~~\n1.cpp:28:29: error: 'numberOfStudents' is not a type\n 28 | vector<int>labMarks(numberOfStudents);\n | ^~~~~~~~~~~~~~~~\nRun Code Online (Sandbox Code Playgroud)\n请告诉我我的错误是什么。\nnumberostudents 应该是向量的大小。但没有任何功能。
\n