// *** before: ***
/* C89 had no boolean type: every project made up its own */
typedef int BOOL;
#define TRUE 1
#define FALSE 0
BOOL flagOld = 5; /* any int fits, and 5 counts as true... */
BOOL sameOld = (flagOld == TRUE); /* ...but it is not equal to TRUE */
/* sameOld is false */
printf("sameOld is %s\n", sameOld ? "true" : "false");
// *** in version C99: ***
//the built-in type _Bool holds only 0 and 1;
//<stdbool.h> names it bool and adds true and false
#include <stdbool.h>
bool flag = 5; //any nonzero value becomes 1
bool same = (flag == true);
//same is true
printf("same is %s\n", same ? "true" : "false");