error C2659: “=”: 作为左操作数 ?
//Person.h
#ifndef PERSON_H
#define PERSON_H
#include <string>
using namespace std;
class Person
{
public:
Person(string name);
virtual void work()=0;//纯虚函数
virtual ~Person(){}
private:
string m_strName;
};
#endif
//Worker.h
#ifndef WORKER_H
#define WOEKER_H
#include "Person.h"
class Worker:public Person
{
public:
Worker(string name,int age);
//virtual void work();
private:
int m_iAge();
};
#endif
//Worker.cpp
#include <iostream>
#include "Worker.h"
using namespace std;
Worker::Worker(string name,int age):Person(name)
{
m_iAge = age;//错误1
}
//void Worker::work()
//{
// cout<<"work()"<<endl;
//}
错误 1 error C2659: “=”: 作为左操作数 c:\users\administrator\documents\visual studio 2012\projects\consoleapplication39\consoleapplication39\worker.cpp 7 1 ConsoleApplication39