April 02, 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?

April 02, 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?
>