Objective-C : Mistake BOOL and bool

objective c

I already found out that bool is a C-Type while BOOL is an Objective-C Type. bool can be true or false and BOOL can be YES or NO

For beginners it can be hard to distinguish these types. Is there anything bad that can happend if I use bool instead of BOOL?

Best Answer

BOOL is a signed char, while bool is a int (in fact, it's typedef'd as such in Darwin when compiling with pre-C99 standards). From there, the usual consideration when promoting/demoting between integer types can be followed.