Re: Returning Arrays from Functions

2017-01-18 Thread Samwise via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 23:09:15 UTC, Adam D. Ruppe wrote: 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

Re: Returning Arrays from Functions

2017-01-18 Thread Adam D. Ruppe via Digitalmars-d-learn
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

Re: Returning Arrays from Functions

2017-01-18 Thread Samwise via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 22:37:25 UTC, Adam D. Ruppe wrote: What code do you have now? This is the basic function. It takes all those boolean arguments and does things depending on them, and then takes any extra args that getopt didn't parse and reads them into numbs. That code

Re: Returning Arrays from Functions

2017-01-18 Thread Adam D. Ruppe via Digitalmars-d-learn
What code do you have now?