title: Dynamic 2D array - allocation won't work (segfault)
body: <p>Why wouldn't this work? I've reviewed my code several times and just can't find what's wrong.</p>
  
  <p>Thanks!</p>
  
  <pre><code>void generateData(float** inData, int x, int y){
      inData[0][0]= 3000.0; // SEGFAULT
  }
  
  float** createMatrix(int x, int y){
      float** array= malloc(sizeof(float*) * y);
      for(int i=0; i&lt;y; i++)
          array[i] = malloc(sizeof(float) * x);
  }
  
  int main(int argc, char** argv) {
      float** arr = createMatrix(100,2);
  
      generateData(arr, 100, 2);
  
      return(0);
  }
  </code></pre>