谁能帮我看看我的代码怎么修改
下面是部分代码
Worker.h
#include<string>
#include"Person.h"
using namespace std;
class Worker :public Person
{
public:
Worker(string code = "001", string color = "blue");
~Worker();
void carry();
protected:
string m_strCode;
};
Migrantworker.h
#include"Worker.h"
#include"Farmer.h"
class Migrantworker :public Farmer, public Worker
{
public:
Migrantworker(string name, string code, string color);
~Migrantworker();
};
Migrantworker.cpp
#include"Migrantworker.h"
#include<iostream>
using namespace std;
Migrantworker::Migrantworker(string name, string ncode, string color) :Farmer(name, color), Worker(code, color)
{
cout << "Migrantworker()" << endl;
}
Migrantworker::~Migrantworker()
{
cout << "~Migrantworker()" << endl;
}
我的代码和老师一样,为什么编译错误?错误提示:黑体字code未声明标识符,如何修改