这是为了方便移植而设计的,比如,常用的scanf,printf这类函数位于头文件stdio.h这个文件里面。而这里,由于需要用到bool(布尔型),所以引用了头文件stdbool.h。因为,bool这个关键字在stdbool.h中定义了得,如果不引用,那么bool就会被编译器视为非法字符,就会出错。
bool 是C++中的关键字,C中不支持 所以C99标准中引入了头文件 stdbool.h,包含了四个用于布尔型的预定义宏 define true 1 define false 0 define bool _Bool typdef int _Bool 看看 stdbool.h 的内容就知道了。
网上找 stdbool.h 这个头文件,然后手动加到include文件夹里。
include <stdbool.h> //布尔环境 include <stdint.h> //整型环境 include <tgmath.h> //通用类型数学宏