title: Function return two-dimensional pointer cannot get value from it
body: <p>I have a function which returns the inverse matrix like this:</p>
  
  <pre><code>double** inverse(double (**data)) {
  
      double result[2][2];
      result[0][0] =  data[1][1] /  (data[0][0] * data[1][1] - data[0][1] * data[1][0]);
      result[0][1] = -data[0][1] / (data[0][0] * data[1][1] - data[0][1] * data[1][0]);
      result[1][0] = -data[1][0] / (data[0][0] * data[1][1] - data[0][1] * data[1][0]);
      result[1][1] = data[0][0] / (data[0][0] * data[1][1] - data[0][1] * data[1][0]);
  
      return result;
  }
  </code></pre>
  
  <p>And I have checked values in result, they are right. Then：</p>
  
  <pre><code>    double** s = inverse(gama[FreIdx]);
  
      printf("%f\n", s[0][0]);
  </code></pre>
  
  <p>and I got Exception. An access violation occurred while reading location 0x0......   I am not very familiar with C.  Can anyone tell me what happened?</p>