digitalmars.D.announce - getting the string representing the enum value
- Hasan Aljudy (22/22) Apr 01 2006 say I have an enum
- Hasan Aljudy (2/32) Apr 01 2006
say I have an enum
enum X
{
A,
B,
C
}
and I have
void someFunc( X e )
{
//.. some code
}
I want to print the value of 'e' but I don't want to get a number!! I
want to get a string that represents it. i.e. A or B or C
void someFunc( X e )
{
toString(e);
e.string;
e.value;
//or something like that ..
}
Is there any such thing in D?
Apr 01 2006
Woops, I keep posting in the wrong section, sorry just ignore this. :(
Hasan Aljudy wrote:
say I have an enum
enum X
{
A,
B,
C
}
and I have
void someFunc( X e )
{
//.. some code
}
I want to print the value of 'e' but I don't want to get a number!! I
want to get a string that represents it. i.e. A or B or C
void someFunc( X e )
{
toString(e);
e.string;
e.value;
//or something like that ..
}
Is there any such thing in D?
Apr 01 2006








Hasan Aljudy <hasan.aljudy gmail.com>