Jason Hendriks wrote in a message to Rick Bischoff:
RB> Does anyone know how to declare a variable that holds
RB> only one bit of information.. (You know only two values
RB> (0 or 1)) ???
JH> A very useful header file..
JH> // BOOLEAN.H
JH> enum boolean{false, true};
JH> inline boolean operator!(boolean bState)
JH> { return (bState == true ? false : true); }
I am not sure, but I would code this otherwise. I would do the comparison to
false, as this is the only defined boolean value in C (false is equal to
zero, everything else is considered true). This just in case to return
correct results for an incorrect cast to a boolean.
mvg/wr
--- timEd/2 1.01.g3+
---------------
* Origin: LightHouse BBS ==> I am a H.U.G.O. Member ! (2:285/324.3)
|