title: srand not random at all - alternatives?
body: <p>I was toying around with arrays, populating with pseudo random numbers, finding minimum and maximum values and their indices and number of occurrences and I noticed something strange - <strong>when using srand seeded with time the number of minimum and maximum value occurrences is ALWAYS equal</strong>. This doesn't seem very random to me.</p>
  
  <p><strong>Is there an alternative way of getting a DIFFERENT number of minimum and maximum value occurrences, as one would expect with random numbers?</strong></p>
  
  <p>Here is my code (I am learning so it may be messy and inefficient, recommendations are welcome)</p>
  
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;time.h&gt;
  
  using namespace std;
  
  void findExtremes( const int[], int); 
  
  int main()
  {
      const int lenght = 2000; //define lenght
  
      int array1[lenght];
  
      srand(time(0)); 
  
      for ( int i = 0; i &lt; lenght; i++) //populate array with random numbers and print them out
      {
          array1[i] = rand() % 3000;
          cout &lt;&lt; "Index " &lt;&lt; i &lt;&lt; " = " &lt;&lt; array1[i] &lt;&lt; endl;
      }
  
      findExtremes(array1, lenght);   // call fn
  
      return 0;
  }
  
  void findExtremes( const int array[], int size)
  {
       int maxV, minV, maxI, minI;
       maxV = array[0];
       minV = array[0];
       minI = 0;
       maxI = 0;
  
       for ( int i = 1; i &lt; size; i++)
       {
           if ( array[i] &gt; maxV)
              {
                  maxV = array[i];
                  maxI = i;
              }
           if ( array[i] &lt; minV)
              {
                  minV = array[i];
                  minI = i;
              }
       }
  
       //find the number of occurances for min and max values
  
       int minOcc = 0;
       int maxOcc = 0;
  
       for ( int i = 1; i &lt; size; i++)
       {
               if (array[i] == minV)
                   minOcc++;
               if (array[i] == minV)
                   maxOcc++;
       }
  
       //output
  
       cout &lt;&lt; "\nMinmim value is index " &lt;&lt; minI &lt;&lt; " with value " &lt;&lt; minV &lt;&lt; " and " &lt;&lt; minOcc &lt;&lt; " occurances" &lt;&lt; endl;
       cout &lt;&lt; "\nMaxium value is index " &lt;&lt; maxI &lt;&lt; " with value " &lt;&lt; maxV &lt;&lt; " and " &lt;&lt; maxOcc &lt;&lt; " occurances" &lt;&lt; endl &lt;&lt; "\n";  
  }
  </code></pre>