Boolean datatypes
Wayne A. Christopher
faustus at ucbcad.BERKELEY.EDU
Tue Jun 17 08:06:54 AEST 1986
> typedef enum { false=0,true } bool;
>
> Many current C compilers now implement enums properly (i.e. each enumeration
> is a distinct type) yet they are hardly ever used. Any comments why not ?
The problems come when you write:
bool b;
int a, c;
b = (a == c);
My compiler gives an "enumeration type clash". It would seem that you
can't legally convert integers to enum members...
Wayne
More information about the Comp.lang.c
mailing list