C++ random_shuffle is always giving the same results
<p>The following call for random shuffle is always giving the same results for the vector v</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
#include &lt;cstdlib&gt;

using namespace std;

int main(){
  vector&lt;int&gt; v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  srand(time(0));
  random_shuffle(v.begin(), v.end());
  for (int i = 0; i &lt; v.size(); ++i) printf("%d ", v[i]); printf("\n");
  printf("%d\n", rand() % 100);

  return 0;
}
</code></pre>

<p>I've tried compiling using </p>

<pre><code>g++ -std=c++0x
g++ -std=c++11
</code></pre>

<p>But both give the same results every time so I don't really understand what's going on. </p>

<pre><code>$./a.out
7 1 4 6 8 9 5 2 3 10 
26
$ ./a.out
7 1 4 6 8 9 5 2 3 10 
41
$ ./a.out
7 1 4 6 8 9 5 2 3 10 
39
</code></pre>