The following recursive function should return 0 if the sum of the provided array is negative, and 1 if the sum is greater than or equal to 0. I don't understand why I get an "error: expected expression before return
" when compiling it.
int restituisco(int *p, int len) {
int somma;
if (len == 0)
if (somma < 0)
return 0;
else
return 1;
somma = p[len-1] + restituisco(p,--len);
}