I have a problem with a default constructor in C++. It's a simple thing but can't see what's wrong with it.
I have a constructor with 3 optional parameters, with const values on initialization list:
data::data(int D = 1, int M = 1, int Y = 1583) : Day(D), Month(M), Year(Y)
{
if (!CorrectDate()) throw "Wrong Date!";
}
Why can I call it with one, two or three parameters and it works just fine but doesn't when I call it with no parameters?
data tommorrow();