Convert string[] to char**

Bruce Smith b.e.smith at computer.org
Tue Jun 4 04:49:17 PDT 2013


Thank you Jacob and bearophile ... just had to add a cast to get rid of 
immutable from your suggestion. For completeness, this compiles under 2.063:

     void foo(char** k)
     {
         // body
     }

     string[] mykeys;
     auto ckeys = cast(char**)mykeys.map!toStringz.array;

     foo(ckeys);

Bruce

On 04/06/13 20:59, Jacob Carlborg wrote:
> On 2013-06-04 12:41, bearophile wrote:
>
>> An alternative is something like (untested):
>>
>> auto ckeys = mykeys.map!toStringz.array;
>
> Right, that should work.
>



More information about the Digitalmars-d mailing list