0
#include <iostream>
#include <string>
using namespace std;
class Vehicle
{
private:
string model;
int price;
public:
Vehicle()
{
model="";
price=0;
}
Vehicle(string model, int price);
void setModel(string mee)
{
model=mee;
}
string getModel()
{
return model;
}
};
int main()
{
Vehicle veh;
cout<<"enter model:"<<endl;
cin>>veh.setModel(string mee); //expected primary-expression before mee
}
它有什么问题吗?即时通讯类似的新手在C + +。我没有得到它..请帮助我关于int main。C++继承简单错误
在这里没有继承,我什至不知道你想要什么'cin >> veh.setModel(string mee);'做。 – chris 2015-03-31 02:59:14
http://homes.ieu.edu.tr/ikorkmaz/courses/SE116_Spring2013-2014/sampleInheritanceApplication.pdf 我试图解决这个问题。 – 2015-03-31 03:19:09