Messages in this thread | ![/](/images/icornerl.gif) | | Date | Thu, 22 Sep 2005 07:43:26 +0500 | From | Fawad Lateef <> | Subject | Re: A pettiness question. |
| |
On 9/22/05, Nick Warne <nick@linicks.net> wrote: > > Interesting. I thought maybe this way was trick, until later I experimented. > > My post here (as Bill Stokes): > > http://www.quakesrc.org/forums/viewtopic.php?t=5626 > > So what is the reason to doing !!num as opposed to num ? 1:0 (which is more > readable I think, especially to a lesser experienced C coder). Quicker to > type? >
I think using !! is quick and the place where it is used, will look little bit odd (like you say in #define or macros) if some one use num ? 1 : 0 ...... And I think lesser experienced C coder will learn other ways of doing same things !!!!!
> My quick test shows compiler renders both the same? >
Ya, I think both !! and num ? 1: 0 will result in same thing by compiler
-- Fawad Lateef - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |