You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
358 B
20 lines
358 B
#include <iostream>
|
|
#include "mydate.h"
|
|
|
|
mydate::mydate(int _year, int _month, int _day)
|
|
: year{_year}, month{_month}, day{_day}
|
|
{
|
|
std::cout << "创建了日期对象 ";
|
|
print();
|
|
}
|
|
|
|
mydate::~mydate()
|
|
{
|
|
std::cout << "撤销了日期对象 ";
|
|
print();
|
|
}
|
|
|
|
void mydate::print()
|
|
{
|
|
std::cout << year << '-' << month << '-' << day << '\n';
|
|
} |