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
  • 208,748
  • 37
  • 389
  • 560
some_id
  • 29,466
  • 62
  • 182
  • 304
  • 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

11

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
  • 398,885
  • 90
  • 523
  • 479