how do you append arrays?

Nicholas Wilson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 25 05:40:40 PST 2016


On Thursday, 25 February 2016 at 13:38:56 UTC, ag0aep6g wrote:
> On 25.02.2016 14:33, Nicholas Wilson wrote:
>> Note that D has zero based array indexing
>> so assuming your array has 100 elements history[1..100]
>> is going one past the end of the array.
>
> No, that's fine. `history[1..100]` gives you 99 elements 
> starting at index 1, i.e. all except the first one.

Derp. You are correct, I was thinking about the first index.



More information about the Digitalmars-d-learn mailing list