Subj : Re: Really **wonderful** website for C interview questions!!!!! To : comp.programming From : Robert Bunn Date : Sun Jul 03 2005 05:58 pm "Alan Morgan" wrote in message news:d9eump$28u$1@xenon.Stanford.EDU... > In article <42baa97c$0$22622$da0feed9@news.zen.co.uk>, > Joe Butler wrote: > >Oooookaaaaay... > > > >I'm not a novice, but at risk of being labelled one, I'm looking at x= !!y > >wondering... > > > >I'd assume that !! would be interpreted as NOT NOT and have the effect of > >turning any non-zero integer number into a 1, and leaving 0 as 0. ?? > > Yup. The basic problem is that two true values might not compare equal to > one another because all non-zero values are true. Using !! ensures that true > values will compare equal to one another. > Okay. I guess I *am* a novice. How is if(x == (!!y) ) any more useful (or clear) than if(x && y) ? Or am I misinterpreting your statement *very* badly indeed? -- Rob .