的声明我有一个非常简单的C代码:误差枚举
#include<stdio.h>
int main()
{
enum boolean{true,false};
boolean bl=false;
if(bl==false)
printf("This is the false value of boool\n");
boolean bl1=true;
if(bl1==true)
{
printf("This is the true value of boool\n");
}
return 0;
}
我只是想用枚举类型的变量。但它给以下错误:
tryit4.c:5: error: ‘boolean’ undeclared (first use in this function)
tryit4.c:5: error: (Each undeclared identifier is reported only once
tryit4.c:5: error: for each function it appears in.)
tryit4.c:5: error: expected ‘;’ before ‘bl’
tryit4.c:6: error: ‘bl’ undeclared (first use in this function)
tryit4.c:8: error: expected ‘;’ before ‘bl1’
tryit4.c:9: error: ‘bl1’ undeclared (first use in this function)
我没有看到任何理由。你能解释一下可能的原因吗?
有些gyz可能有太多的空闲时间,没有比在互联网上生气更好的事情了。 – 2009-12-15 19:44:38
@mawia:点击你的用户名,选择“活动”,然后浏览你所提出的所有问题,并从每个问题中选择一个最佳答案。 – wallyk 2009-12-15 19:48:22
感谢所有的答复! – mawia 2009-12-15 20:01:24