title: Newbie in C - wrong return type
body: <p>I have a function similar to this using pointers in C</p>
  
  <pre><code>float *compute_avg(float *array, int num_elements) {
    float sum = 0.f;
    int i;
    for (i = 0; i &lt; num_elements; i++) {
      sum += array[i];
    }
    return sum;
  }
  </code></pre>
  
  <p>But error occurs "return value type does not match function type".</p>