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

  • From: thescriptdevil@xxxxxxxxx (Ashok Gautham)
  • Date: Sat, 17 Dec 2011 13:50:18 +0530

On Sat, Dec 17, 2011 at 11:20:30AM +0530, 0 wrote:



Does 'C' language specification has 'boolean' datatype ?


Nope, just define one using typedef such as,

#define true 1
#define false 0
typedef int bool;

This is a bad thing to recommend given that there is a standard header
<stdbool.h> for the same purpose. And since it is C99, it should be
there on any system. 

---
Ashok Gautham.

Other related posts: