Have not noticed before, recently in C language write DSP algorithm, accidentally found my function in the definition of BOOL type variable in VC6.0 (I mainly use it to check the syntax error) in the compilation actually error, said the bool type is not defined. It took so long C and C + +, has always felt that the basic type of bool, C language should be built-in type, how can not be defined? It turns out that my idea was completely wrong.
With the network, all the problems have become so easy, I easily searched the relevant answers.
There is no bool (Boolean) type in C, C + +, which means that there is no problem in C + + using the bool type. The bool type has only two values: true = 1, false=0.
However, the C99 standard also defines the BOOL type variable. At this point, as long as the introduction of the header file <stdbool.h>, you can use the bool type in the C language normally. I have verified this in Fedora9, and its own compiler is GCC 4.3.0, which complies with the C99 standard. But in the VC6.0, will be reported to find not the head file Stdbool.h error, it seems VC6.0 really older.
So, to be compatible with a variety of compilers, or define it yourself. ^_^
#define BOOL Char
#define TURE 1
#define FALSE 0
Http://www.cnblogs.com/roucheng/p/css3menu.html
http://roucheng.cnblogs.com/
Is there a bool type in C language?