Re: Question about "enums"
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Mon, 01 May 2006 08:13:28 +1200
Harald van Dijk wrote:
Ian Collins wrote:
venkatesh wrote:
u can make use of okloop whereever u want "1"
if if is not that please correct me
What are you replying to? Please quote the context.
Assuming you are refereing to:
enum loop { NO, YES};
enum loop okloop=YES;
You would use loop whenever you wanted YES. Use an enum for what it is,
if you wanted a synonym for 1, use a const (unsigned) int.
A const int can't be used in constant expressions.
Another oversight that should have been fixed.
I'll admit declaringNo, it's the only tidy workaround for the previous oversight.
okloop as int in that example is probably not a good idea, but do you
have a problem with unnamed enums used to define constants too?
--
Ian Collins.
.
- References:
- Question about "enums"
- From: mdh
- Re: Question about "enums"
- From: venkatesh
- Re: Question about "enums"
- From: Ian Collins
- Re: Question about "enums"
- From: Harald van Dijk
- Question about "enums"
- Prev by Date: Re: Boost process and C
- Previous by thread: Re: Question about "enums"
- Next by thread: #iidef and #define to debug program
- Index(es):
Relevant Pages
|