[Ilugc] [Technical] Does 'C' language specification has 'boolean' datatype ?

  • From: akilan27@xxxxxxxxx (Akilan R)
  • Date: Sat, 17 Dec 2011 14:29:47 +0530

On Sat, Dec 17, 2011 at 2:22 PM, 0 <0 at 0throot.com> wrote:

It was just a simple code snippet to indicate bool can be quickly added.
I agree, it should not be used exactly as mentioned since the naming is
too generic. OP can chose whether to use stdbool.h or add 3 lines to his
code, to me this is just a moot point.


No, C99 and stdbool.h are much more than that. It simply defines bool to be
_Bool which is not same as integer typedef you define.
_Bool is a full fledged boolean variable that can convert other values to 1
or 0 when stored according to standard rules in a transparent way. In fact
one need not use stdbool.h if one is happy with typing _Bool. (but not
recommended)

-- 
?????? (Akilan R)
[ blog.akilan.in ]
*I should have no use for a paradise in which I should be deprived of the
right to prefer hell.*
  --Jean Rostand

Other related posts: