title: function not returning the correct argument
body: <p>I have a function declared like this</p>
  
  <pre><code>int * return_array(int * arr1 , int * arr2);
  </code></pre>
  
  <p>and the function is defined like this</p>
  
  <pre><code>int * return_array(int * arr1, int * arr2)
  {
      int arr_sum[5]={0};
      int count = 0;
      do
      {
          arr_sum[count] = *(arr1+count)+*(arr2+count);
          count ++;
      }
      while (count &lt; 5);
      return (arr_sum);
  }
  </code></pre>
  
  <p>this is how i am trying to access the returned array in the main function</p>
  
  <pre><code>int *get_arr;
  get_arr=return_array(arr1,arr2);
  cout &lt;&lt; "Their sum is :"
       &lt;&lt; endl;
  for (count = 0; count &lt; 5; ++count)
  {
       cout &lt;&lt; *(get_arr+count)
            &lt;&lt; endl;
  }
  </code></pre>
  
  <p>the first sum is correct but the rest looks to be garbage values, what might be the cause?</p>