当我尝试使用某个结构时,我得到了一个“‘data’的存储大小未知”的提示。
代码:
ioHelper.h:
#ifndef IOHELPER_H_
#define IOHELPER_H_
typedef struct fileValues data;
struct fileValues ioInput(FILE* file,int dim,int sign);
#endif /* IOHELPER_H_ */
ioHelper.c:
struct fileValues
{
int dim;
char sign;
double x;
double y;
};
map.c:
void drawData(FILE* vectors)
{
double paramLoc [MAX_DIMENSION];
char sign;
(this is where i get the error) struct fileValues data;
...
}
有什么想法吗?
发布于 2011-08-14 12:15:49
这是因为在编译map.c时,编译器无法在IoHelper.c中看到结构的完整定义。
您可能只包含了IoHelper.h,它有(不完整的)声明,没有定义。
因此您不能在map.c中声明该结构类型变量,除非您
https://stackoverflow.com/questions/7054961
复制相似问题