title: Passing Array to a function and Adding it through Recursion
body: <p>What em trying to do is pass the array to a function which will add all the array elements and return the output. Please help me. i dont know what i am doing wrong in this :/</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define MAX 5
  
  int arraySum(int *dArr,int lim);
  
  int main()
  {
      int array[MAX] = {9,7,4,2,10};
      printf("%d", arraySum(array, MAX));
      return 0;
  }
  int arraySum(int *dArr,int lim)
  {
      int Ans;
      if(lim&gt;0)
      Ans = dArr[lim] + arraySum(*dArr, lim--);
      return Ans;
  } 
  </code></pre>