title: Got an srand error and would like to know if there are other ways to improve this code
body: <p>Basically this is a program to play with dice but i have a problem with srand. it gives an error stating "implicit conversion loses integer precision: 'time_t' (aka 'long') to 'unsigned int'"
  whys that ? </p>
  
  <p>Also i would like to know if there are any other ways to improve this code? currently i only know stdio.h i know there are some out there like iostream or something like that. is there a possible way to explain those to me also. </p>
  
  <p>Here is the code. 
  i know crt secure no warning is to ignore some errors but i would still like to know why it the error pops up ? </p>
  
  <pre><code>#define _CRT_SECURE_NO_WARNINGS 
   #define MAX_CHIPS 400 
  
  #include &lt;stdio.h&gt; 
  #include &lt;stdlib.h&gt; 
  #include &lt;time.h&gt;   
  
  void display_details(void); 
  int throws_die(void); 
  int main() so on
  {
      int die1, die2, throw_sum; 
      int PointToMake; 
  
  
      int Games_Played = 0; 
      int Games_Won = 0;  
      int Games_Lost = 0; 
  
  
      int CurrentChips = MAX_CHIPS; 
          int BetChips;
  
      char PlayerName[30];   
      char PlayAgain; 
  
  
      display_details(); 
  
      srand(time(NULL));
  
      printf("Would you like to play Test your luck [y|n]?\n"); 
      scanf(" %c", &amp;PlayAgain);
      while ((PlayAgain == 'y') &amp;&amp; (CurrentChips &gt; 0))
      {
          if (Games_Played == 0)//shows how many games played which is obviously 0
          {
              printf("A new chellenger! What is your name?\n");
              scanf(" %s", &amp;PlayerName);           
              printf("Hi %s!\n", PlayerName);     
          }
  
          Games_Played = Games_Played + 1;//each new game it will increase by 1
  
          printf("Number of chips: %d\n", CurrentChips);
          printf("Place your bet:\n "); 
          scanf("%d", &amp;BetChips); 
  
  
          while ((BetChips &lt; 0) || (BetChips &gt; CurrentChips))  
          {
              printf("uuh ....You can only bet the chips you have.. (0-%d)!\n", CurrentChips);
              printf("Place your bet: \n");
              scanf("%d", &amp;BetChips);
          }
  
  
          die1 = throws_die();
          die2 = throws_die();
          throw_sum = die1 + die2;
          printf("You Got: %d + %d = %d\n", die1, die2, throw_sum);
  
  
          if ((throw_sum == 7) || (throw_sum == 12))
          {
              //+1 to games won
              Games_Won = Games_Won + 1;
              //adding to bet balance
              CurrentChips = CurrentChips + BetChips;
              printf("XXXXX  Winner! d(^_^)  XXXXX\n");
          }
  
          else if ((throw_sum == 2) || (throw_sum == 3) || (throw_sum == 10))
          {
  
              Games_Lost = Games_Lost + 1;
  
              CurrentChips = CurrentChips - BetChips;
              printf("XXXXX  Loser! :( XXXXX\n");
          }
  
          else
          {
  
              PointToMake = throw_sum;
              printf("Points to make is: %d\n", PointToMake);
  
  
              die1 = throws_die();
              die2 = throws_die();
              throw_sum = die1 + die2;
              printf("    |---&gt;&gt; Spinned: %d + %d = %d\n", die1, die2, throw_sum);
  
  
              while (throw_sum != PointToMake &amp;&amp; throw_sum != 7)
              {
                  die1 = throws_die();
                  die2 = throws_die();
                  throw_sum = die1 + die2;
                  printf("    |---&gt;&gt; Spinned: %d + %d = %d\n", die1, die2, throw_sum);
              }
  
  
              if (throw_sum == PointToMake)
              {
                  printf("XXXXX  Winner! (x2 the bet) XXXXX\n");
                  //x2 added to balance
                  CurrentChips = CurrentChips + 2 * BetChips;
                  Games_Won = Games_Won + 1;
              }
              else
              {
  
                  Games_Lost = Games_Lost + 1;
                  CurrentChips = CurrentChips - BetChips;
                  printf("XXXXX  Loser!:(  XXXXX\n");
              }
          }
  
  
          if (CurrentChips &gt; 0)
          {
              printf("You now have %d chips.\n", CurrentChips);
              printf("============================\n\n");
              printf("Play Again %s [y|n]? ", PlayerName);   
              scanf(" %c", &amp;PlayAgain);   
              printf("============================\n");
          }
          else  
          {
              printf("you're out of chips.\n");
              printf("XXXXX  GG TRY AGAIN NEXT TIME  XXXXX\n");
          }
      }
  
  
      if (Games_Played == 0)
      {
          printf("Oh well.... better luck next time!\n");
      }
  
      else if (Games_Played == 1)
      {
          printf("%s played %d game and is cashing out with %d chips!\n", PlayerName, Games_Played, CurrentChips);
          printf("   |---&gt; Games won: %d\n", Games_Won);
          printf("   |---&gt; Games lost: %d\n", Games_Lost);
          printf("Thanks for playing, come again to test that luck of yours %s.\n", PlayerName);
      }
  
      else
      {
  
          printf("%s played %d games and is cashing out with %d chips!\n", PlayerName, Games_Played, CurrentChips);
          printf("   |---&gt; Games won: %d\n", Games_Won);
          printf("   |---&gt; Games lost: %d\n", Games_Lost);
          printf("\nThanks for playing, come again to test that luck of yours %s!\n", PlayerName);
      }
      return 0;
  }
  
  void display_details(void)  
  {
      printf("File     :.... assignment.c\n");
      printf("Author   :.... \n");
      printf("Stud ID  :.... \n");
      printf("Email ID :.... \n");
      printf("This is my own work as defined by the \n");
      printf("University's Academic Misconduct Policy.\n");
  }
  
  int throws_die(void)
  {
      return 1 + rand() % 6;  
  </code></pre>