简单的类定义疑问
#include <string.h>
//---------------------------------------
class CEmployee //基类
{
private:
char m_name[30];
public:
CEmployee(); // 函数重载
CEmployee(const char* nm) { strcpy(m_name, nm); }
};
//---------------------------------------
class CWage : public CEmployee
{
private :
float m_wage;
float m_hours;
public :
CWage(const char* nm) : CEmployee(nm) { m_wage = 250.0; m_hours = 40.0; }
//CWage(const char* nm) : CEmployee(nm) 表示什么意思
void setWage(float wg) { m_wage = wg; }
void setHours(float hrs) { m_hours = hrs; }
float computePay();
};