#include<iostream>
#include<string>
#include<vector>
using namespace std;
class Course
{
public:
string name;
string instructorInCharge;
int numberOfStudents;
int totalMarks;
Course(string u, string v, int p, int q){
this->name=u;
this->instructorInCharge=v;
this->numberOfStudents=p;
this->totalMarks=q;
}
vector<int> studentMarks (numberOfStudents);
};
class Labs:public Course
{
vector<int>labMarks(numberOfStudents);
};
int main()
{
Course c("Rahul","Hota",200,300);
cout<<"hello there";
}
When I compile this code I’m getting the following error:
1.cpp:20:31: error: 'numberOfStudents' is not a type
20 | vector<int> studentMarks (numberOfStudents);
| ^~~~~~~~~~~~~~~~
1.cpp:28:29: error: 'numberOfStudents' is not a type
28 | vector<int>labMarks(numberOfStudents);
| ^~~~~~~~~~~~~~~~
Please tell me what my mistake is. numberostudents was supposed to be the size of the vector. But not any function.