c++总是提示基类未定义 error C2504: 'Prices' : base class undefined
classPrices{private:doubletotalprice;public:virtualdoublegettotalprice(intn){for(i=0;...
class Prices{
private:double totalprice;
public:
virtual double gettotalprice(int n)
{
for(i=0;i<n;i++){totalprice=0;totalptice+=menulist[i].num*menulist[i].price;
return totalprice;
}
};
class Discount:public Prices{
public:
virtual double gettotalprice(int n)
{
for(i=0;i<n;i++){totalprice=0;totalptice+=menulist[i].num*menulist[i].price;
return totalprice*0.75;
}
}; 展开
private:double totalprice;
public:
virtual double gettotalprice(int n)
{
for(i=0;i<n;i++){totalprice=0;totalptice+=menulist[i].num*menulist[i].price;
return totalprice;
}
};
class Discount:public Prices{
public:
virtual double gettotalprice(int n)
{
for(i=0;i<n;i++){totalprice=0;totalptice+=menulist[i].num*menulist[i].price;
return totalprice*0.75;
}
}; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询