number ranges

forkit forkit at gmail.com
Mon Jan 17 10:24:06 UTC 2022


so I'm wondering why the code below prints:

1 2 3 4

and not

1 2 3 4 5

as I would expect.

foreach (value; 1..5) writef("%s ", value);

also, why is this not possible:

int[] arr = 1..5.array;




More information about the Digitalmars-d-learn mailing list