parent
953f7c4fa7
commit
d3dbad9a52
@ -0,0 +1,20 @@
|
|||||||
|
#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';
|
||||||
|
}
|
Loading…
Reference in new issue