can someone explain how i could go about applying this recursive method to a string of integers from a text file.
so far i have read the string into an int array in my main using a tokenizer and im unsure of how i should manipulate the array now.
also does the int list[] parameter in my method need to be initialized even though its being passed to the actual array parameter in the main?
my objective here is to recursively add the array of integers.
any good advice would be appreciated.
static int sumarray(int list[],int size)
{
int currentTotal;
int total;
if ( size == 0 )
total = 0;
else
currentTotal = sumarray( list, size - 1 );
total = currentTotal + list;
return total;
}