Change your constructor:
class date2019
{
private int m;
private int d;
public date2019(int month = 1, int day = 1)
{
m = month;
d = day;
}
}
Now when you construct and instance with the
new
keyword you can supply the month and day, or optionally omit them and they will default to January 1st.