title: C - Get random words from text a file
body: <p>I have a text file which contains a list of words in a precise order.
  I'm trying to create a function that return an array of words from this file. I managed to retrieve words in the same order as the file like this: </p>
  
  <pre><code>char *readDict(char *fileName) {
  
      int i;
  
      char * lines[100];
      FILE *pf = fopen ("francais.txt", "r");
  
      if (pf == NULL) {
          printf("Unable to open the file");
      } else {
  
          for (i = 0; i &lt; 100; i++) {
  
              lines[i] = malloc(128);
  
              fscanf(pf, "%s", lines[i]);
  
              printf("%d: %s\n", i, lines[i]);
          }
  
  
          fclose(pf);
  
          return *lines;
      }
  
      return "NULL";
  }
  </code></pre>
  
  <p>My question is: How can I return an array with random words from the text file; Not as the file words order?</p>
  
  <p>The file looks like this:</p>
  
  <pre><code>exemple1
  exemple2
  exemple3
  exemple4
  </code></pre>