From: Doug Eleveld Newsgroups: comp.os.msdos.djgpp Subject: Re: enum problem Date: Mon, 15 Jun 1998 12:01:52 +0200 Organization: Rijksuniversiteit Groningen Lines: 23 Message-ID: <3584F110.76F55ACA@dds.nl> References: NNTP-Posting-Host: client36-38.oprit.rug.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Eli Zaretskii wrote: ---snip--- > Also, I strongly suspect that the type of an expression "a|b" is an > int, regardless of its value. (Could any ANSI guru please confirm > this?) Yes, I C++ it does, and I expect in C also. Almost all operations on enums produce ints. Except of course when there global operators in scope like this: enumtype operator|(const enumtype one, const enumtype two) { return enumtype((int)one|(int)two)); } There is a big thread in comp.lang.c++.moderated called 'C++ and enums' which discuss this. Go find it on dejanews. Hope this helps, Doug Eleveld