title: Segmentation Fault - declare and init array in C
body: <p>I am very new to C. coming from Python, Java and C# worlds. This might be a stupid question but I am getting segmentation fault:</p>
  
  <pre><code>// struct for storing matrices
  typedef struct {
      int m;
      int n;   
      float* elts;
  } Matrix;
  </code></pre>
  
  <p>and in my main method:</p>
  
  <pre><code> Matrix A;
      A.n = 3;
      A.m = 3;
      memcpy( A.elts, (float[]) {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}, 9 * sizeof(float));  // seg fault because of this memcpy.
  </code></pre>
  
  <p>I also tried without the <code>f</code>, same issue.
  Can you help please</p>