C语言使用中的细节问题总结

1、在使用bool关键字时,出现"error:'bool' undeclared(first use in this function)"的错误,原因为C语言本身是没有bool关键字的,在99年的ANSI/ISO-C99标准之后加入的布尔类型关键字为_Bool。解决办法可以有:

1)使用bool,需要添加头文件#include <stdbool.h>;

2)使用_Bool关键字;

3) #define bool int
    #define true 1
    #define false 0

posted @ 2016-10-13 14:26  xiemingwang  阅读(317)  评论(0编辑  收藏  举报