On Sat, Dec 17, 2011 at 01:12:10PM +0530, Raja Subramanian wrote:
> Since C defines any non-zero value as true, rather than defining true as 1
> you better define true as !0. Ie, true is the opposite of false.
> 
> This is the only way to ensure that a test against 2 true values will work
> in all cases.

True. Interestingly, I have seen some code bases (Minix?) that use ! !
condition to make sure the value becomes 0 or 1.

For example,

        int a = 113;
        printf("%d\n", !!a);
        
will display 1

---
Ashok Gautham
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to