I have created a constructor, but why there is still have an error "no default constructor exists for class"? I have searched for the answer to the question, but I am still not clear about this error. Can someone help me?
pragma once
#include<string>
using namespace std;
class Date
{
private:
int month;
int day;
int year;
public:
Date(int newmonth, int newday, int newyear)
{
month = newmonth;
day = newday;
year = newyear;
}
};
class Student
{
private:
string name;
Date birthDay;
int score;
public:
Student(string newname, Date newbirthDay, int score)
{
}
};