title: Can I return double * in function?
body: <p>Can I do something like this? Will this work?</p>
  
  <pre><code>double *vec_subtraction (char *a, char *b, int n)
  {   
      double *result;
      int i;
  
      for(i=0; i&lt;n; i++)
          result[i] = a[i]-b[i];
  
      return result;
  }
  </code></pre>
  
  <p>and then in main:</p>
  
  <pre><code>double *vec=vec_substraction(a, b, n);
  for(i=1; i&lt;n; i++)         
      printf("%d", vec[i]);
  </code></pre>
  
  <p>a and b are vectors with the same number of elements, n is number of elements.</p>