BOOL和Boolean的区别

BOOL的本质.
             typedef signed char BOOL; 

             实际上BOOL类型的变量 是1个有符号的char变量.

 

 

             #define YES ((BOOL)1)

             #define NO  ((BOOL)0)

 

             YES  实际上就是 1

             NO  实际上就是 0

Boolean的本质
            typedef unsigned char                   Boolean;

            实际上Boolean类型的变量 是1个无符号的char变量.

             #define true 1

             #define false 0

你可能感兴趣的:(BOOL和Boolean的区别)