error C2039: 'rp' : is not a member of 'date'
errorC2039:'rp':isnotamemberof'date'怎么解决#include<iostream>usingnamespacestd;classdate...
error C2039: 'rp' : is not a member of 'date'怎么解决
#include<iostream>
using namespace std;
class date
{
private:
int n,m,d;
public:
void D(){cout<<"日为:"<<d<<'\n';};
void M(){cout<<"月为:"<<m<<'\n';};
void N(){cout<<"年为"<<n<<'\n';};
int rq(int a,int b,int c)
{
n=a;
m=b;
d=c;
}
void qu();
};
void date::qu()
{
cout<<"日期为"<<n<<'.'<<m<<'.'<<d<<'\n';
}
int main()
{
int a,b,c;
cout<<"请设置日期"<<'\n';
cin>>a>>b>>c;
date A;
A.rp(a,b,c);
A.D();
A.M();
A.N();
A.qu();
return 0;
} 展开
#include<iostream>
using namespace std;
class date
{
private:
int n,m,d;
public:
void D(){cout<<"日为:"<<d<<'\n';};
void M(){cout<<"月为:"<<m<<'\n';};
void N(){cout<<"年为"<<n<<'\n';};
int rq(int a,int b,int c)
{
n=a;
m=b;
d=c;
}
void qu();
};
void date::qu()
{
cout<<"日期为"<<n<<'.'<<m<<'.'<<d<<'\n';
}
int main()
{
int a,b,c;
cout<<"请设置日期"<<'\n';
cin>>a>>b>>c;
date A;
A.rp(a,b,c);
A.D();
A.M();
A.N();
A.qu();
return 0;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询