title: C: How to pass a double pointer to a function
body: <p>I am getting an segmentation fault when I pass the double pointers to the function to initialize the memory</p>
  
  <pre><code>int main()
  {
      double **A;
      initialize(A, 10, 10);
   ......
  }
  
  void initialize(double **A, int r, int c)
  {
     A = (double **)malloc(sizeof(double *)*r);
     for(int i = 0; i&lt; r; i++) {
          A[i] = (double *)malloc(sizeof(double) *c);
          for(int j = 0; j &lt; c; j++) {
              A[i][j] = 0.0;
          }
     }
  }
  </code></pre>
  
  <p>How can I pass the double pointers to the functions.....</p>