I have actually an enum in c++:
class myClass
{
public:
enum ExampleType
{
TEST1
TEST2
TEST3
TEST4
}
};
I would like to print the enum not as number but as String.. Actually it prints 0 .. 1 .. 2 .. 3 I would like it print TEST1 or TEST2 etc ...
I already try Switch case as :
std::string type;
switch (this->type)
{
case 0: type = "TEST1";
case 1: type = "TEST2";
case 2: type = "TEST3";
case 3: type = "TEST4";
}
then print type, but he don't go in the right case ..
How can it be possible ?