An enum
is just a way to set fancy, compile time type safe names for enums. What happens is that each of your enum values get assigned a numerical integer value:
enum Points
{
// Explicitly map point2d to value 2.
point2d = 2,
// Let point2w get an automatic mapping - will be previous + 1 = 3.
point2w,
// Explicitly map pint3d to value 3.
point3d = 3,
// Let point3w get an automatic mapping - will be previous + 1 = 4.
point3w
}
So to the runtime, the statement Points pt3d = point3d
is the same as Points pt3d = 3
. When displaying, the debugger simply takes the first enum value mapped againts 3, which is point2w
.