• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ObjC BOOL and boolean c expressions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ObjC BOOL and boolean c expressions


  • Subject: Re: ObjC BOOL and boolean c expressions
  • From: "Clark Cox" <email@hidden>
  • Date: Fri, 31 Aug 2007 11:00:35 -0700

On 8/31/07, John Stiles <email@hidden> wrote:
> I *think* that the C spec doesn't specify the result of a boolean
> expression other than "zero means false, nonzero means true."

No, *all* of C's operators that return a boolean result return either
1 or 0. So the result of any of:

(==,!=,<,>,<=,>=,!,&&,||)

will never be anything but 1 or 0. This is also true in C++ (unless
one of the operators is overloaded to do something else).

--
Clark S. Cox III
email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: ObjC BOOL and boolean c expressions (From: Charles Steinman <email@hidden>)
 >Re: ObjC BOOL and boolean c expressions (From: John Stiles <email@hidden>)

  • Prev by Date: Re: file scan results in EX_BAD_ACCESS
  • Next by Date: Re: ObjC BOOL and boolean c expressions
  • Previous by thread: Re: ObjC BOOL and boolean c expressions
  • Next by thread: Re: ObjC BOOL and boolean c expressions
  • Index(es):
    • Date
    • Thread