title: Same random numbers generated every time in C++
body: <p>Here is the code I have:</p>
  
  <pre><code>int main(int argc, char** argv) {
  
      int sleeptime = atoi(argv[1]);    
      int sleepCount = atoi(argv[2]);
  
      int sleepTimeRandom = 1 + (rand() % (int)(sleeptime));
      int sleepCountRandom = 1 + (rand() % (int)(sleepCount));
  
      sleepTimeRandom = sleepTimeRandom * 1000;
  
      DWORD id = GetCurrentProcessId();
  
      cout &lt;&lt; "\n\nProcess with id " &lt;&lt; id &lt;&lt; " will sleep for " &lt;&lt; sleepTimeRandom &lt;&lt; " milliseconds\n";
      cout &lt;&lt; "\n\nProcess with id " &lt;&lt; id &lt;&lt; " will sleep " &lt;&lt; sleepCountRandom &lt;&lt; " times \n";
  </code></pre>
  
  <p>When I call the exe like </p>
  
  <pre><code>sleeper 4 4 
  </code></pre>
  
  <p>I always get 2000 milliseconds, 4 times.. Why?</p>