title: generating simple random number with time in c
body: <p>Im using this function:</p>
  
  <pre><code>int rand2(int lim)
  {
          static long a = 1;  // could be made the seed value
          a = (a * 32719 + 3) % 32749;
          return ((a % lim) + 1);
  }
  </code></pre>
  
  <p>to get a stack of random number, it work fine but each time i launch this function I will have the same stack of number, so I want to use the time() system function to have each time a different stack</p>
  
  <pre><code>int rand3(int lim, int dat_time)
  {
    static int a = dat_time; // could be made the seed value                                                       
    a = (a * 32719 + 3) % 32749;
    return ((a % lim) + 1);
  }
  </code></pre>
  
  <p>then i give one time the time() of my computer since the variable a is a static</p>
  
  <pre><code>int             main()
  {
    int           rd;
    time_t        timee;
    int           seed;
  
    timee = 0;
    timee = time(timee);
    seed = timee;
    while(42)
      {
        rd = rand3(52, seed);
        printf("%d\n", rd);
        getchar();
      }
  }
  </code></pre>
  
  <p>Then i get an error saying dat_time is not a constant, but since i use it one time I dont get why</p>