参见英文答案 > Using boolean values in C 13个
我正在尝试使用返回类型作为boolean创建一个函数…程序的语法似乎是正确的但编译器给出错误….@H_301_3@
@H_301_3@
#includedio.h>
#include
@H_301_3@
34.bool checknull(struct node* node){
35. if ( node != NULL )
36. return TRUE;
37.
38. return false;
39.}
我在编译时得到的是@H_301_3@
@H_301_3@
bininsertion.c:34:1: error: unknown type name ‘bool’
bininsertion.c: In function ‘checknull’:
bininsertion.c:36:10: error: ‘TRUE’ undeclared (first use in this function)
bininsertion.c:36:10: note: each undeclared identifier is reported only once for each function it appears in
bininsertion.c:38:9: error: ‘false’ undeclared (first use in this function)
我用小写和大写字母都试过“真,假”,但似乎没有用……
最佳答案