有三个文件:employee.h,employee.cpp,employees.cpp
employee.h
*************************************************
#include<iostream.h>
class employee{
public:
char *name;
employee(char s[32]);
virtual void print();
virtual void print_status();
};
*************************************************
employee.cpp
*************************************************
#include"employee.h"
employee::employee(char *s)
{
name=s;
}
void employee::print()
{
cout<<name<<endl;
print_status();
}
void employee::print_status()
{
cout<<"single person!"<<endl;
}
*******************************************************
employees.cpp
******************************************************
#include"employee.h"
#include"employee.cpp"
void main()
{
char *p="xiaoming";
employee k(p);
k.print();
}
********************************************************
编译的时候错误:employee' : 'class' type redefinition
为什么,请大家帮忙改一下可以吗?谢谢各位了!
[此贴子已经被作者于2006-3-6 21:01:37编辑过]