#include <stdio.h>
typedef struct
{
int num ;
} NUMBER ;
int main(void)
{
struct NUMBER array[99999];
return 0;
}
我收到编译错误:
error: array type has incomplete element type
我相信问题是我错误地声明了结构数组。我查了一下,好像你就是这么声明的。
struct NUMBER array[99999];
应该
NUMBER array[99999];
因为你已经typedef
编辑你的结构。
编辑:由于OP声称我建议他的内容不起作用,我编译了这个测试代码并且它工作正常:
#include <stdio.h>
typedef struct
{
int num ;
} NUMBER ;
int main(void)
{
NUMBER array[99999];
array[0].num = 10;
printf("%d", array[0].num);
return 0;
}
See the 运行代码 http://ideone.com/Kj91B0.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)