Returning Arrays from Functions

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 18 15:09:15 PST 2017


On Wednesday, 18 January 2017 at 22:51:17 UTC, Samwise wrote:
> 	numbs[] = getInp(help, file, inp, args);

This is wrong, try just `numbs = getImp(...);`

numbs[] = xxx will copy stuff into the existing array, which is 
empty right now. You want to jut keep the slice the function 
passes back.


More information about the Digitalmars-d-learn mailing list