Samantha <samantha.domville@gmail.comwrites:
[...]
Quote:
Quote:
>Samantha <samantha.domvi...@gmail.comwrites:
[...]
Quote:
Quote:
Quote:
typedef enum Fruit
{
Apple = 0,
Orange,
Banana = 0xFF
} FruitIndex;
[...]
Quote:
So, what is the point of having created a enum name FruitIndex with a
member Orange, if we don't use FruitIndex as an entity?
for the same reason we have the name "int" even though we don't write
"int.42".
Either "enum Fruit" or "FruitIndex" is the name of the type you've
created. You can, for example, declare objects of that type:
FruitIndex obj;
obj = Banana;
(Due to C's strange rules, the constant Banana is actually of type
int, but you can assign its value to an object of type FruitIndex.)
--
Keith Thompson (The_Other_Keith)
kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"