哪位能手帮下
//stdafx.h#include <iostream>
#include<string>
#include <Emp.h>
using namespace std;
//Emp.h
using namespace std;
class CEmp
{
public:
CEmp();
virtual~CEmp(){delete[] name;}
void set_name(char *);
void set_age(short a){age=a;};
void set_salary(float s){salary=s;};
void print();
private: char *name;
short age;
float salary;
}
//Emp.cpp
#include"stdafx.h"
#include "Emp.h"
CEmp::CEmp()
{
name=0;
age=0;
salary=0;
}
void CEmp::set_name(char *n)
{
name=new char(strlen(n)+1);
strcpy(name,n);
}
void CEmp::print()
{
cout<<"Name:"<<name;
cout<<"Age:"<<age;
cout<<"Salary:"<<salary<<endl;
}
//text.cpp
#include "stdafx.h"
int main(int argc,char* argv[])
{
char *name=NULL;
short age=0;
float salary=0;
name=new char[30];
CEmp emp[3];
for(int i=0;i<3;i++)
{
cout<<"输入第"<<i+1<<"员工的信息"<<endl;
cout<<"姓名:";
cin>>name;
cout<<"年龄:";
cin>>age;
cout<<"工资:";
cin>>salary;
emp[i].set_name(name);
emp[i].set_age(age);
emp[i].set_salary(salary);
emp[i].print();
}
return 0;
}
错误f:\工具\visual c++6.0\msdev98\myprojects\009\stdafx.h(17) : fatal error C1083: Cannot open include file: 'Emp.h': No such file or directory
帮忙看下。为什么打不开Emp.h 头文件啊