I have been trying to figure out what is wrong with this code. All I want is an array of structures. But the compiler tells me
functions.cpp:54: error: no matching function for call to `Visits::Visits()'
. I initialized the records, still the same error. I am able to do it in C but as soon as I go to C++ it does not like it. Maybe someone knows why.
Date::Date(int mn, int dy, int yr);
void Date::setDay(int d);
void Date::setMonth(int m);
void Date::setYear(int y);
Your Date class has no default constructor, and since it is a member of your Visits class, Visits is not allowed to have a default constructor either. You should create a default constructor for your Visits class that initializes d correctly, or provide a default constructor for your Date class.