【发布时间】:2012-02-06 14:21:29
【问题描述】:
这是我的 C 程序...
#include <stdio.h>
struct xyx {
int x;
int y;
char c;
char str[20];
int arr[2];
};
int main(void)
{
struct xyz a;
a.x = 100;
printf("%d\n", a.x);
return 0;
}
这是我得到的错误......
按 ENTER 或输入命令继续
13structtest.c:在函数“main”中: 13structtest.c:13:13:错误:“a”的存储大小未知 13structtest.c:13:13:警告:未使用的变量“a”[-Wunused-variable]【问题讨论】:
-
我更喜欢 MSVC,而不是 GCC 给出的相当神秘的错误:
error C2079: 'a' uses undefined struct 'xyz' -
感觉自己像个白痴!谢谢:)
-
我建议将其标记为
gcc,因为这是编译器特定的问题