delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/05/20/12:08:41

Message-ID: <20020520160611.9371.qmail@web11307.mail.yahoo.com>
Date: Mon, 20 May 2002 09:06:11 -0700 (PDT)
From: Pedro Izecksohn <izecksohn AT yahoo DOT com>
Subject: Re: enum
To: djgpp AT delorie DOT com
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

--- Pedro Izecksohn <izecksohn AT yahoo DOT com> wrote:
> 
> --- Eric Sosman <esosman AT acm DOT org> wrote:
> > Pedro Izecksohn wrote:
> > > 
> > > #define something enum something
> > > something {
> > > a,b,c,d,e };
> > > 
> > > #define otherthing enum otherthing
> > > otherthing {
> > > a,s,d,f,g };
> > > [...]
> > 
> >     If this were permitted, what output should
> > `printf ("d = %d\n", d);' produce?  `d' means 3
> > in the "something" context, but 2 if regarded as
> > an "otherthing;" which context is correct for the
> > printf() call?
> > 
>    To refer some content of some enum not being to attrib
> it's value to that type of enum variable would be
> prohibted. So: printf ("d = %d\n", d); would be
> prohibted,
> but: first=d; printf ("%d", first); would produce 3, and:
> second=d; printf ("%d", second); would produce 2.
> 
   Because according to ANSI, in the code: "enum name {
a,b,c,d } varname;", what is the purpose of "name" if to
"a" is being attribed a value that is valid in all the file
?


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019