🔥博客主页:小王又困了 📚系列专栏:C++ 🌟人之为学,不日近则日退 ❤️感谢大家点赞👍收藏⭐评论✍️ 目录 一、日期类的实现 通过前面的知识,我们要实现一个日期类,巩固前面学习的类和对象。这里我们也要使用多文件来完成我们的日期类。 头文件中是我们要实现日期类功能的函数声明。这里我们要注意拷贝函数,只能在函数声明时写缺省值,防止我们在声明和定义是给的缺省值不一样。 #include <iostream> #include <assert.h> using namespace std; class Date { public: Date(int year = 1, int month = 1, int day = 1); void Print(); int GetMonthDay(int year, int month); bool operator==(const Date& y); bool operator!=(const Date& y); bool operator>(const Date& y); bool operator<(const Date& y); bool...