Re: if statements vs. switch
Re: if statements vs. switch
- Subject: Re: if statements vs. switch
- From: Ondra Cada <email@hidden>
- Date: Wed, 4 Sep 2002 19:21:22 +0200
On Wednesday, September 4, 2002, at 06:08 , Jeremy Dronfield wrote:
...and can't find them in the C docs I've got...
Get the good ole Kernigan/Ritchie book. It's still the best C tutorial,
and conditional expressions are decribed there all right.
In short,
exp1 ? exp2 : exp3
evaluates exp1; if true (nonzero), evaluates exp2 and makes its resut the
result of whole expression. Otherwise, it evaluates exp3 and makes its
resut the result of whole expression.
Beware ?: priority is pretty low: a?b:c+1 means that "c+1" is exp3, not
the other way round.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.