VC6.0中如何实现多个文件的编译
em04] #include "student.h" //在此文件中进行函数的定义#include <iostream>
using namespace std;
void Student::display( )
{ cout<<"num:"<<num<<endl;
cout<<"name:"<<name<<endl;
cout<<"sex:"<<sex<<endl;
}
void Student::set_value()
{ cin>>num;
cin>>name;
cin>>sex;
}
----------------------------------
#include "student.h"
//#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
Student stud;
stud.set_value();
stud.display();
return 0;
---------------------------------
class Student
{ public:
void display( );
void set_value();
private:
int num;
char name[20];
char sex ;
};
--------------------------------------
自已先在VC6.0做一个工程文件把头文件也加进去了,老是提示
ompiling...
student.cpp
i\2_4student类工程函数\student\student.cpp(13) : fatal error C1010: unexpected end of file while looking for precompiled header directive
student1.cpp
i:\student\student1.cpp(15) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
Error executing cl.exe.
student.exe - 2 error(s), 0 warning(s)
不知如何才好!感谢你的帮助!!