qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: Re: completely OT: C Q/As, was Re: security_20040618


From: Charlie Gordon
Subject: [Qemu-devel] Re: Re: completely OT: C Q/As, was Re: security_20040618
Date: Tue, 22 Jun 2004 14:37:46 +0200

"Sander Nagtegaal" <address@hidden> wrote in message
news:address@hidden
> Something else...............I'm new to C++ ( but this is C code but the
same
> in C++) so don't shoot me.......

I'm just a teaser, not an executionner.

> Isn't enum { FALSE=0 , TRUE=1 } compleetly stupid anyway. I mean........is
> FALSE=0 then enum will automaticly make TRUE 1 right? So then
> enum {FALSE=0 , TRUE } ; would be better right?

Well, yes and no.  You correctly analyse that the initializer for TRUE is
redundant, as a matter of fact both initialisers are useless.
So I could have written :

enum BOOL { FALSE, TRUE };
or whatever typedef is appropriate.

But I prefer to make certain things more explicit.  I find it more readable.
Not exactly what you call "completely stupid" !

Now if you want to flame something completely stupid, look at this one :

#define FALSE 0==1
#define TRUE  1==1

Why will this fail ?

Chqrlie.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]