The class GroupA
{
Enum T {
Student1=0,
Student2,
Student3,
}
};
The class GroupB
{
Enum T {
Student4=0,
Student5,
Student6,
}
};
Above GroupA and GroupB Student Numbers from 0 begin, how to realize a new class or enumeration, allow the Student1 Student6 numbered sequentially 0,1,2,3,4,5?
The class GroupAB: public GroupA, public GroupB
{
};
Directly inherited this number will not change, is there any possible way, guide, thank you.
CodePudding user response:
No,No answers, is the problem wrong,
This is your confusion of problems and solutions,
CodePudding user response:
The code above 2 points. You1. T is defined by the type enum, pay attention to this is the type, not variable, similar int, members can only is a variable or function in a class
2. Both enumeration class from zero beginning, how to distinguish Student1/Student4
CodePudding user response: