#include <iostream>
using namespace std;
class Car {
public:
string a;string b; string c; string d; string e;
Car(string ID, string Model, string Power, string Color, string Price);
void set(string newID, string newModel, string newPower, string newColor, string newPrice)
{
ID = newID;
Model = newModel;
Power = newPower;
Color = newColor;
Price = newPrice;
}
void get()
{
ID; Model;Power;Color;Price;
}
void Display()
{
cout << "编号" << ID << "的" << Model << "型汽车的颜色是" << Power << ",功率为" << Color << "马力" << ",价格为" << Price << endl;
}
private:
string ID, Model, Power, Color, Price;
};
int main() {
string newID;string newModel; string newPower; string newColor; string newPrice;
Car c("100001", "tax1","1000kw", "蓝色"," 10000000" );
cout << "请依次输入第一辆车的ID、Model、Power、Color、Price" << endl;
cin >> newID >> newModel >> newPower >> newColor >> newPrice;
c.set(newID, newModel, newPower, newColor, newPrice);
c.Display();
cout << "请依次输入第二辆车的ID、Model、Power、Color、Price" << endl;
cin >> newID >> newModel >> newPower >> newColor >> newPrice;
c.set(newID, newModel, newPower, newColor, newPrice);
c.Display();
return 0;
}
严重性 代码 说明 项目 文件 行 禁止显示状态
错误 LNK2019 无法解析的外部符号 "public: __thiscall Car::Car(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Car@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0000@Z),函数 _main 中引用了该符号 5-1 C:\Users\19338\source\repos\5-1\2020112035lab5-1.obj 1