Why I could not cast string to int?

Adam D. Ruppe destructionator at gmail.com
Thu Feb 2 08:24:21 PST 2012


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