>>928496>no, that's stupid. The function can create its own array, having to provide it with a blank one* violates separation of concerns.If you have problem with providing blank one, you can do it in outer function which will have fewer parameters and only the inner one with the array will be recursive.
>Maybe start by not using recursion to populate an array. I know for loops are super lame, but this is a textbook example of what they are (hoho) for.You are like the retards from stackoverflow in pic related. Anon asked how to do it with recursion.
>>928495why sum? you wanted to return numbers
the function should be
>>928495 like
int[] generateNumbers (int a, int b, int[] foo)
it will create new array
bar[foo.length+1]
copy foo array to it
System.arraycopy(foo, 0, bar, 0, foo.length);
add a to the end
bar[foo.length] = a
and if a!=b recurse
return generateNumbers (a+1, b, bar)
otherwise
return bar