这个程序错误在哪里?#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
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 10:41:23
这个程序错误在哪里?#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
这个程序错误在哪里?
#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
这个程序错误在哪里?#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了.在书上有详解的,别告诉我你木看.