Chris Cason wrote:
> If he wants brevity he could also code it like this:
>
> for (int i = 0; i < c.size(); i++)
> out.append(c[i] ? "1" : "0");
>
> which is just as valid and avoids running the if/else together.
Ooo, I like that. (It makes it clear that append() is always called, and
it's only the argument that changes depending on c[i].)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|