title: Can not print out the elements of an array in a for-loop
body: <p>Why can not I print out the elements of an array in a <code>for</code>-loop?
  My environment is Windows 7 Maximum,
  gcc (MinGW.org GCC-6.3.0-1) 6.3.0
  I input the data from the prompt like <code>3 1 2 3</code>.
  I can do, e.g., <code>printf(&quot;%&quot; PRId64 &quot; &quot;, marray[2])</code> but from the <code>for</code>-loop it doesn't work.</p>
  <p>Here is the source code:</p>
  <pre><code>#define __USE_MINGW_ANSI_STDIO 1
  #define __STDC_FORMAT_MACROS 1
  
  #include &lt;inttypes.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  size_t read_size() {
      size_t x;
      scanf(&quot;%lu&quot;, &amp;x);
      return x;
  }
  
  int64_t read_int64() {
      int64_t x;    
      scanf(&quot;%&quot; SCNd64, &amp;x);
      return x;
  }
  
  int main() {
      size_t *size;
      *size = read_size();
      int64_t *marray = malloc(sizeof(int64_t) * *size);
      for (size_t i = 0; i &lt; *size; i++) {
          marray[i] = read_int64();
      }
          
      for (size_t i = 0; i &lt; *size; i++) {
          printf(&quot;%&quot; PRId64 &quot; &quot;, marray[i]);
      }
      free(marray);
      return 0;
  }
  </code></pre>