I have an enumeration as a public memebr class as follows:
class myClass
{
public:
enum myEnum
{
myEnum1,
myEnum2
};
};
I also declare public constructors parameterized as follows:
myClass(myEnum);
I define the same thing outside the class definition as follows:
myClass :: myClass(myEnum E)
{
}
How to initialize myEnum with default arguments?
I tried:
i)
myClass :: myClass(myEnum E = 0);
b)
myClass :: myClass(myEnum E = {0});
III)
myClass :: myClass(myEnum E = {0, 1});
One thing that I still do not understand.
How to pass enum values to a constructor. I am still getting an error. And I need to do it like this:
derived(arg1, arg2, arg3, enumHere, arg4, arg5);
Function Definition:
derived(int a, int b, int c, enumHere, int 4, int 5) : base(a, b);
Where should I initialize the enumeration, as one of the answers below?