下面是我的代码:
数学核心.h
#ifndef __CC_MATHCORE_H__
#define __CC_MATHCORE_H__
#include "math.h"
class MathCore
{
public:
MathCore();
virtual ~MathCore( );
int x (int n );
};
#endif
数学核心.cpp
#ifndef __CC_MATHCORE_H__
#define __CC_MATHCORE_H__
#include "MathCore.h"
MathCore::MathCore()//a
{
}
MathCore::~ MathCore()//b
{
}
int MathCore::x (int n )//c
{
float v=0;
return v;
}
#endif
但它报错
a:C++ requires a type specifier for all declarations
Use of undeclared identifier 'MathCore'
b:Expected a class or namespace
c:Expected a class or namespace
欢迎您的评论