Re: Question about "enums"
- From: "Bill Pursell" <bill.pursell@xxxxxxxxx>
- Date: 30 Apr 2006 00:33:10 -0700
Ian Collins wrote:
mdh wrote:
Ian Collins wrote:An enum is a type, which in this case can have one of two values, YES
oklopp us a variable of the enum type loop, so you can assign either NO
or YES to it.
and NO.
Assigning any other value to a loop is undefined. Unfortunately C
compilers don't regard this as an error, which renders enums little more
than symbolic constants.
gcc gives a warning when you do a switch on an enum type, indicating
that you have failed to explicitely specify behavior for any of the
listed cases. I find that very useful.
.
- Follow-Ups:
- Re: Question about "enums"
- From: Ian Collins
- Re: Question about "enums"
- References:
- Question about "enums"
- From: mdh
- Re: Question about "enums"
- From: Ian Collins
- Re: Question about "enums"
- From: mdh
- Re: Question about "enums"
- From: Ian Collins
- Question about "enums"
- Prev by Date: Re: First program in C - what is going on with function returns?
- Next by Date: Re: Question about "enums"
- Previous by thread: Re: Question about "enums"
- Next by thread: Re: Question about "enums"
- Index(es):
Relevant Pages
|
|