title: Getting words from text file to an array
body: <p>My text file is formated like that:</p>
  
  <pre><code>my.txt
  Red
  Green
  Blue
  Yellow
  </code></pre>
  
  <p>I'm tring to get words like that:</p>
  
  <pre><code>typedef char * string;
  main(){
     int i;
     string array[4];
  
     FILE *my;
     my = fopen("my.txt","r");
     for(i = 0; i &lt; 4; i++)
           fscanf(data, "%s", &amp;array[i]);
     fclose(my);
  }
  </code></pre>
  
  <p>When I try to print the array there is an error. What's wrong with my code and how can I fix it?</p>