Alex Rønne Petersen Wrote: > On 02-02-2012 17:26, xancorreu wrote: > > 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. > > > > Because D is a strongly typed language. Casting a string to an int > doesn't make sense from a type system perspective. > > -- > - Alex
- Why I could not cast string to int? xancorreu
- Re: Why I could not cast string to int? David Nadlinger
- Re: Why I could not cast string to int? xancorreu
- Re: Why I could not cast string to int? Adam D. Ruppe
- Re: Why I could not cast string to int? xancorreu
- Segment violation (was Re: Why I could n... xancorreu
- Re: Why I could not cast string to int? Alex Rønne Petersen
- Re: Why I could not cast string to i... bearophile
- Re: Why I could not cast string to i... bearophile
- Re: Why I could not cast string... Ali Çehreli
- Re: Why I could not cast st... Jonathan M Davis
- Re: Why I could not cast string... Jonathan M Davis
- Re: Why I could not cast string... xancorreu
- Re: Why I could not cast string... Ali Çehreli
- Re: Why I could not cast st... Jonathan M Davis
- Re: Why I could not cas... xancorreu
- Re: Why I could not cas... Jonathan M Davis
- Re: Why I could not cast st... xancorreu