Re: Conversion string-int

2014-06-07 Thread monarch_dodra via Digitalmars-d-learn
On Saturday, 7 June 2014 at 20:53:03 UTC, Paul wrote: 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));

Re: Conversion string-int

2014-06-07 Thread anonymous via Digitalmars-d-learn
On Saturday, 7 June 2014 at 20:53:03 UTC, Paul wrote: 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));

Re: Conversion string-int

2014-06-07 Thread Paul via Digitalmars-d-learn
On Saturday, 7 June 2014 at 21:15:37 UTC, monarch_dodra wrote: On Saturday, 7 June 2014 at 20:53:03 UTC, Paul wrote: 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]

Re: Conversion string-int

2014-06-07 Thread Jonathan M Davis via Digitalmars-d-learn
On Sat, 07 Jun 2014 20:53:02 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: 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]