这是我要编译的程序
#include<stdio.h>
int main()
{
int i = 0;
rec(i);
}
int rec(int i)
{
i = i + 1;
if (i == 10){return true;}
rec(i);
printf("i: %d\n", i);
}
我得到这个输出
$ gcc -o one one.c
one.c: In function ‘rec’:
one.c:10:24: error: ‘true’ undeclared (first use in this function)
one.c:10:24: note: each undeclared identifier is reported only once for each function it appears in
据我所知,布尔真值在 c 中为 1。如果是这样,为什么我会收到错误消息?