title: Shuffle array in C
body: <p>I'm looking for a function in ANSI C that would randomize an array just like PHP's <code>shuffle()</code> does. Is there such a function or do I have to write it on my own? And if I have to write it on my own, what's the best/most performant way to do it? </p>
  
  <p>My ideas so far:</p>
  
  <ul>
  <li>Iterate through the array for, say, 100 times and exchange a random index with another random index</li>
  <li>Create a new array and fill it with random indices from the first one checking each time if the index is already taken (performance = 0 complexity = serious)</li>
  </ul>