Objective-C : BOOL vs bool

Posted by santoni on Stack Overflow See other posts from Stack Overflow or by santoni
Published on 2009-02-12T13:46:05Z Indexed on 2010/04/05 16:53 UTC
Read the original article Hit count: 575

Filed under:
|
|
|

Hi,

I'm new to objective-c and I saw the "new type" BOOL (YES, NO).

I read that this type is almost like a char.

For testing I did :

NSLog(@"Size of BOOL %d", sizeof(BOOL));
NSLog(@"Size of bool %d", sizeof(bool));

Good to see both display 1 (sometimes in C++ bool just an int and sizeof is 4)

So I was just wondering I there were some issues with the bool type or something ?

Can I just use bool (that seems to work) without loosing speed?

Thanks for answers

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about boolean