Using .length returns incorrect number of elements

Chris M. chrismohrfeld at comcast.net
Sun Aug 19 15:53:25 UTC 2018


On Sunday, 19 August 2018 at 15:49:18 UTC, Chris M. wrote:
> On Sunday, 19 August 2018 at 15:44:07 UTC, QueenSvetlana wrote:
>> [...]
>
> auto appendNumber = appender(arrayofNumbers);
>
> This returns a separate object. You probably meant to put this 
> for the last line
>
> writeln(appendNumber.length);

Whoops

writeln(appendNumber.data.length);

https://run.dlang.io/is/4aNx1l


More information about the Digitalmars-d-learn mailing list