Possible Duplicate:
Possible to add another item to an existing enum type?
Say I have a class Car
with the following enum defined:
typedef enum
{
DrivingForward,
DrivingBackward
} DrivingState;
Then, let's say I have a subclass of Car
called Tesla
and it happens to drive sideways too. Is there a way for Tesla
to add new items to that original enum so that the final enum becomes like the following?
typedef enum
{
DrivingForward,
DrivingBackward,
DrivingLeft,
DrivingRight
} DrivingState;