If I have an enumeration:
enum SizeType
{
Tiny = 0,
Small,
Big,
Massive,
OMG
};
If I declare a variable like this:
SizeType myVar ;
I want to be able to print the appropriate string when I coerse/cast
myVar to string by calling the ToString() method - does anyone know how
I can "assign string values" to the enums (not technically correct), so
that the ff code:
SizeType myVar = SizeType.Tiny ;
//I'll just use C++ here, since I'm still learning C#
std::cout << "The enum mVar has a string representation of: '" <<
myVar.ToString() << "'\n";
Which should print the ff on stdio:
The enum mVar has a string representation of 'Tiny'