title: Array of pointers to char * in c using qsort
body: <p>While adding string to my pointer's array, it is being overwriten by the last one. Could anyone tell me, where's my mistake?</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main (){
  int ile = 3;
  const char * slowa[ile];
  for(int j = 0; j &lt; ile; j++){
      char string[30];
      gets(string); 
      slowa[j] = string;
      printf ("%s dodalem pierwsza\n",string);
  }
  for (int i = 0; i &lt; ile; i++) {
      printf ("%s numer %d\n",slowa[i],i);
  }
  return 0;
  }
  </code></pre>