Message-ID: <20020520154554.15904.qmail@web11302.mail.yahoo.com> Date: Mon, 20 May 2002 08:45:54 -0700 (PDT) From: Pedro Izecksohn Subject: Re: enum To: djgpp AT delorie DOT com In-Reply-To: <3CE8B6F5.4337A883@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --- Eric Sosman 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. __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com