I am new to this and I am having a problem. I want to use an array as a parameter in the constructor, but when I want to initialize the parameter in the main() function and call the class, it seems I can't directly put the array values as I did with the name and surname. The simplified code looks like below. It shows an error that the default constructor is not available.
class Student {
private:
string name;
string surname;
int age;
int grade[5];
public:
Student(string e, string b, int c,int A[5]) {
name = e;
surname = b;
age = c;
for (int i = 0; i < 5; i++)
grade[i] = A[i];
}
};
int main() {
Student obj = Student("Jack","blalba", 18, {10,10,9,8,8});
}