解决方法1: 导入头文件 #include <stdbool.h> 但是有些编译器没有这个头文件,那么可以使用方法2. 解决方法2:自己定义一个bool型 typedef num {false = 0,true = 1}bool;