C++Builder 程序员博客
29 Aug
//function.h
struct site
{
double a;
double b;
…………
}
extern site site_data[NUM];//NUM为常量
//tin.h
class T_tin
{
public:
T_tin();
~T_tin();
void CreatPoint(site * site_data);
…………
}
在tin.cpp里实现。
在main里使用时,出错
error C2061: syntax error : identifier 'site'
正确的应该怎么改?谢谢大家了。
在线等。
已经加过了,
#ifndef _TIN_H_
#define _TIN_H_
#include "function.h"
…………
…………
#endif
还是一样的错误。
谢谢。
//可以改成这样 //—function.h — #define NUM 5 struct site { double a; double b; //………… }; extern site site_data[NUM]; //NUM为常量 //—tin.h— #include "function.h" #include <iostream> using namespace std; class T_tin { public: T_tin(){}; ~T_tin(){}; void CreatPoint(site * site_data); //………… }; //—main.cpp— #include "tin.h" void main() { }
找到错误了。谢谢3楼。我在function.h 里有包含了tin.h.文件互相包含就出错了、