Reputation: 79
enum testing{a,b,c}; testing eg; int xyz = 1;
How do i get value "b" using xyz variable? something like eg(xyz)...
Upvotes: 2
Views: 127
Reputation: 1155
You could just:
eg = static_cast<testing>(xyz);
Upvotes: 3