In general an enum is going to be used as a type definition and should always be in the header file. Things to think about are the scope of it.
If the enum is just placed outside any scope in the header, it will be globally available to any thing that includes the header file. If you instead want the enum only accessible to the class itself, you can place it in the private section of the class.
In general you shouldn't make the enum globally scoped, instead you should either put it in a namespace or in the public section of a class. Then you can access the enum by way of
NamespaceOrClass::EnumValue
Also, as a sidenote, enums automatically iterate values from the first one you give (or 0).
enum
{
kCP_AboutBox_IconViewID = 1,
kCP_AboutBox_AppNameViewID = 2,
kCP_AboutBox_VersionViewID = 3,
kCP_AboutBox_DescriptionViewID = 4,
kCP_AboutBox_CopyrightViewID = 5
};
Is exactly the same as
enum
{
kCP_AboutBox_IconViewID = 1,
kCP_AboutBox_AppNameViewID,
kCP_AboutBox_VersionViewID,
kCP_AboutBox_DescriptionViewID,
kCP_AboutBox_CopyrightViewID
};
It's not a problem or error, just stylistic really.