Enum vs Strongly typed enum
06:03 25 Sep 2012

I am a beginner in C++ programming.

Today I come across a new topic: strongly typed enum. I've researched it a bit but till now I am unable to find out why do we need this and what is the use of the same?

For example if we have:

enum xyz{a, b, c};
/*a = 0, b = 1, c = 2, (Typical C format)*/

Why do we need to write:

enum class xyz{a, b, c};

What are we trying to do here? My most important doubt is how to use it. Could you provide a small example, which will make me understand.

c++ c++11 enums