You are viewing a single comment's thread. Return to all comments →
Just use recursion!
int simpleArraySum(int ar_count, int* ar) { if (ar_count == 0) return 0; else return ar[0] + simpleArraySum(ar_count - 1, ar+1); }
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
Just use recursion!