Re: enum question
On Thu, 29 Apr 2010, www wrote:
Jeff Higgins wrote:
Can you use an EnumSet? You don't say how you intend to use your
hierarchy of enums.
Thank you. I rephrase my question as following:
I need to have two Enum types. Most elements of the two are the same, but
there are some different ones.
enum CarModelOfFactor1
{
CarModelA, CarModelB, CarModelC, CarModelM
}
enum CarModelOfFactor2
{
CarModelA, CarModelB, CarModelC, CarModelX, CarModelW
}
I just hate to code "CarModelA, CarModelB, CarModelC" twice inside the
two enums. I am wondering if there is a better way to do it.
Why do there have to be multiple enums? What are they used for? Could you
have one big enum which had all the values?
tom
--
Formal logical proofs, and therefore programs - formal logical proofs
that particular computations are possible, expressed in a formal system
called a programming language - are utterly meaningless. To write a
computer program you have to come to terms with this, to accept that
whatever you might want the program to mean, the machine will blindly
follow its meaningless rules and come to some meaningless conclusion. --
Dehnadi and Bornat