作业帮 > 综合 > 作业

这个程序错误在哪里?#include using namespace std;class Date{public:voi

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/03 13:24:22
这个程序错误在哪里?
#include
using namespace std;
class Date{
public:
void setDate(int y,int m,int d);
void showDate();
private:
int year;
int month;
int year;
};
void Date::setDate(int y,int m,int d)
{
year=y;
month=m;
day=d;
}
void Date::showDate()
{cout
私有成员只能用接口访问,在你的基础上把private改成public可以通过,或者用你的show接口,要不然不就白定义show了.在书上有详解的,别告诉我你木看.