由于 C 没有 boolean 类型,我如何在 C 中编写这样的函数:
bool checkNumber()
{
return false;
}
最佳答案
bool
类型在 <stdbool.h>
中定义 header ,并以名称 _Bool
提供否则(假设您使用的是 C99 编译器)。如果你没有 C99,你总是可以像这样发明你自己的 bool 类型:
typedef enum {false, true} bool;
关于c - 在 C 中编写一个返回 boolean 值的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4752993/