5

What is the difference between BOOL and Boolean in Objective C ?

Does it matter which one is used?

If not, why do they both exist?

Thanks

Paul R
  • 202,568
  • 34
  • 375
  • 539
some_id
  • 28,896
  • 60
  • 180
  • 299
  • 1
    possible duplicate of [Objective-C : BOOL vs bool](http://stackoverflow.com/questions/541289/objective-c-bool-vs-bool) – Matthew Vines Jan 12 '11 at 22:11

1 Answers1

10

There's no functional difference1 between Objective-C's BOOL data type and the various flavors of boolean types provided by, e.g., stdbool.h for C. However, idiomatic Objective-C code uses the BOOL type (and the values YES and NO) for boolean values.

1. There are some differences. For example, a BOOL is actually a signed char, whereas (on my machine) stdbool.h defines _Bool_ and bool to be an int.

mipadi
  • 380,288
  • 84
  • 512
  • 473