[courses] [c] lesson 11: enumerating boolean/hacking vim
Morgon Kanter
admin at surgo.net
Thu Nov 14 16:27:31 EST 2002
> > enum boolean {false, true};
> > #define boolean enum boolean
>
> You might want to reconsider this and use a typedef instead.
>
> typedef enum {false, true} boolean;
that would work better I guess. But when putting both through a sizeof, they
are both needlessly 4 bytes. It seems the most economical way is
#define boolean short
#define false 0
#define true 1
--
Fetch my UPDATEd public key from http://www.surgo.net/pubkey.asc
Sorry PGP users, it's likely incompatable.
More information about the Courses
mailing list