[Ilugc] [Technical] Does 'C' language specification has 'boolean' datatype ?
- From: 0@xxxxxxxxxxx (0)
- Date: Sat, 17 Dec 2011 14:22:26 +0530
#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.
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.
--
0
Other related posts: