title: Why do I get a warning about possible loss of data when seeding the random number generator from time(NULL)?
body: <p>am learning vectors and made a bit of code that selects random numbers i can use for buying lottery tickets here in Netherlands. But although it runs, the compiler is warning me about 'conversion from 'time_t' to 'unsigned int, possible loss of data'.</p>
  
  <p>Can anyone spot what is causing this? I haven't even defined any unsigned int in this code; int i by default is a signed int as i understand. Thanks for insight. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include &lt;ctime&gt;
  using namespace std;
  
  void print_numbers();
  string print_color();
  
  int main() {
  srand(time(NULL));
  print_numbers();
  string color = print_color();
  cout &lt;&lt; color &lt;&lt; endl;
  
  system("PAUSE");
  return 0;
  }
  
  //Fill vector with 6 random integers. 
  //
  void print_numbers() {
  vector&lt;int&gt; lucky_num;
  
  for (int i = 0; i &lt; 6; i++) {
      lucky_num.push_back(1 + rand() % 45);
      cout &lt;&lt; lucky_num.at(i) &lt;&lt; endl;
  }
  }
  
  //Select random color from array.
  //
  string print_color() {
  string colors[6] = {"red", "orange", "yellow", "blue", "green", "purple"};
  int i = rand()%6;
  return colors[i];
  }
  </code></pre>
  
  <p>Exact compiler message: warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data. Line 11.</p>