Re: Enumeration in Interface
You can do it, but I'm not aware of any enumerated types that are members of an interface. All the enumerated types I can think of are members of a namespace directly and not nested within a class or other type.
Re: Enumeration in Interface
Oi, I did not know that!
I just created the enumeration BEFORE the class declaration, and it works.
Thought everything got to be inside a class. Little confused, but will look into it.
Some explanation would be welcome though. :)
Re: Enumeration in Interface
An enumeration is a type in itself, so you can define one anywhere you can define a class, or any other type for that matter. It can be nested within another type, like a class or interface, or it can be defined elsewhere in a code file. You might define it in the same file as a class, but outside the class definition, or you could define it in its own code file, along with other types or on its own.
Re: Enumeration in Interface
Thanks matey!
Wonder how many other things is there I don't have a clue about. :sick:
Re: Enumeration in Interface
Quote:
Originally Posted by StrangerInBeijing
I just created the enumeration BEFORE the class declaration
That means it is in the same namespace as the class who's declaration follows it's declaration.
There is actually no link between them, other than being declared in the same file.