char* to string

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Thu Nov 5 00:20:03 PST 2009


BLS wrote:
> On 05/11/2009 00:11, BLS wrote:
>> char* xxx()
> 
> better
> char* xxx(char* a, char* b)
> {
>   string A = ????
> }


std.conv.to() is your friend. Man, I love that function!

   import std.conv;

   char* xxx(char* a, char* b)
   {
       string A = to!string(a);
   }

-Lars


More information about the Digitalmars-d-learn mailing list