BOOL vs Boolean

What is the difference between BOOLand Booleanin Objective-C?

Does it matter which one is used?

If not, why do they both exist?

thank

+5
source share
1 answer

There is no functional difference 1 between the Objective-C data type BOOLand the various variants of Boolean types provided, for example, stdbool.hfor C. However, the idiomatic Objective-C code uses the type BOOL(and the values ​​of YESand NO) for Boolean values.

1. There are some differences. For example, BOOLit is really a signed charwhile (on my machine) stdbool.hdefines _Bool_and BOOLhow int.

+10

All Articles