Why I could not cast string to int?

xancorreu xancorreu at gmail.com
Thu Feb 2 08:26:26 PST 2012


Why cast(int) does not work and I have to call another function?

Thanks,

Al 02/02/12 17:24, En/na Adam D. Ruppe ha escrit:
> On Thursday, 2 February 2012 at 16:21:39 UTC, xancorreu wrote:
>> $ ./factorial 222
>> Factorial requires a number
>
> args[0] is the name of your program.
> (The first thing you typed on the command
> line.)
>
> Use args[1] to get that number.
>
>> parse() where is the doc?
>
> http://www.d-programming-language.org/phobos/std_conv.html#parse
>
>
> to!int(args[1]) is probably what you want here though.



More information about the Digitalmars-d-learn mailing list