|
From: Bob W. <bo...@ph...> - 2002-04-17 18:27:52
|
The default is 0, and then each consequtive one is +1 the previous =
one. You can change the value of an enum by initialising it to something =
else, i.e.
enum farmyard {cow, sheep, pig, chicken, fruitbat =3D 1000, elephant, =
pigmi}
so cow =3D 0, sheep =3D 2, etc.. and then fruitbat =3D 1000, elephant =
=3D 1001, and so on.
Absolutely correct, but when you assign a value to an enumerated =
element, it practically destroys or greatly limits the ability to use =
the enumerated elements in a for loop or switch statement.=20
Regards,
Bob Wilson
|