Conversion string->int

Paul via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jun 7 13:53:02 PDT 2014


I can not understand, why this code works:

     char s[2] = ['0', 'A'];
     string ss = to!string(s);
     writeln(parse!uint(ss, 16));

but this can deduces template:

     char s[2] = ['0', 'A'];
     writeln(parse!uint(to!string(s), 16));

What's the reason? And what is the right way to parse 
char[2]->int with radix?


More information about the Digitalmars-d-learn mailing list