这是half.h 文件
class student1
{
public:
float i;
public :
float shalf(float i);
};
student1::shalf(float i)
{
i=i*0.5;
return i;
}
下面是.cpp文件
#include "iostream.h"
#include
#include "StdAfx.h"
#include
void main()
{
student1 s1;
float h=100;
float i;
i=s1.shalf(h);
count<<i<<endl;
}
编译时出错E:\c++\102\102.cpp(11) : error C2065: 'student1' : undeclared identifier