title: Access violation when filling the char* array
body: <p>I've written a code in c:</p>
  
  <pre><code>const char *str[125000]; 
  float k[125000];
  long n;
  char string[20];
  int i;
  scanf("%d",&amp;n);
      for (i=0;i&lt;n;i++)
      {
      scanf("%s%f",&amp;string,&amp;k[i]);
      p=p/k[i];
      str[i]=_strdup(string);
      }
  </code></pre>
  
  <p>At this point everything's perfect. The array gets filled even if the n=100000; However if I change </p>
  
  <pre><code>for (i=0;i&lt;n;i++)
  </code></pre>
  
  <p>to </p>
  
  <pre><code>for (i=n;i&gt;0;i--)
  </code></pre>
  
  <p>i get the "Access violation" error. I've got no idea why is this happening so I'm asking for your help. Thanks in advance.</p>