#include <iostream>
usingnamespace std;
class Date {
void set(int y, int m, int d);
int get_year;
int get_month;
int get_day;
Date();
Date(int y, int m, int d);
void print();
Date plus(int num);
};
***********************************************
#include "date.h"
Date::Date() //default constructor
{
day = 1;
month = 1;
year = 1900;
}
Date::Date(int Month, int Day, int Year) // construct from month/day/year
{
month = Month;
day = Day;
year = Year;
}
void Date::setDay(int d)
{
day = d;
}
void Date::setMonth(int m)
{
month = m;
}
void Date::setYear(int y)
{
year = y;
}
int Date::getDay() const
{
return day;
}
int Date::getMonth() const
{
return month;
}
int Date::getYear() const
{
return year;
}
void Date::print() const
{
if (year < 10) cout <<'0';
cout << year << ",";
if (month < 10) cout <<'0';
cout << month << ",";
if (day < 10) cout <<'0';
cout << day << "." << endl;
}
*******************************************************
#include "date.h"
int main()
{
Date begin;
Date check_in;
int y, m, d;
begin.set (0, 0, 0);
cout << "Please enter Year, Month, and Day: ";
cin >>y>>m>>d;
check_in.set (y, m, d);
cout << "You have entered: ";
check_in.print();
return 0;
}
Expanding on what bluezor said, your functions/constructor are also private (they can be declared public/protected/private as well), so make them public.