August 19, 2010

C boolean

Filed under: C — Tags: , — shijitht @ 3:52 pm

C do not have a built-in boolean type. In C, zero means false and non-zero means true. So we don’t have to use boolean types in comparison operations. If a comparison say  using  “== ”   succeeds, one would be returned. Zero in case of a failure. Run the program to remove debuts,

         printf("False = %d True = %d\n",1==0,1==1);

1 Comment »

  1. […] This post was mentioned on Twitter by Shijith T, Shijith T. Shijith T said: C boolean: http://wp.me/pKpVe-4m […]

    Pingback by Tweets that mention C boolean « Empty cup -- Topsy.com — August 19, 2010 @ 5:20 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: