Here's a clue: use a static int in the function to keep track of the number of calls, eg:
Code:
int sumArray (int **rayptr, int len, int goal) {
static int count = 0;
so the recursion continues until count == (len-1). The last iteration just returns the value at rayptr[count]; the previous iterations return that number plus the next call:
Code:
return rayptr[count] + sumArray(rayptr,len,goal);
[edit] I slightly misunderstood this and thot you were just adding everthing up -- so in fact this function needs no return value, you just have to output rayptr[count]+(8-same) each time.[/edit]