title: random(int) and randomize() in C
body: <p>I want to generate pseudo-random integers in a given range without introducing the skew that results from the use of <code>rand()%N</code>.</p>
  
  <p>I have read about the functions <code>random()</code> and <code>randomize()</code> that seem to substitute the <code>rand()</code> and <code>srand()</code> functions but returning directly an integer in the range given as the parameter of the <code>random()</code> function. In both cases, the functions seem to be in the <code>stdlib.h</code> library. </p>
  
  <p>The problem I have is that I cannot make these functions work somehow. Here's a small test code I made to test the functions. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(){
   randomize(); 
   printf("%d\n",random(100));
   return 0;
  }
  </code></pre>
  
  <p>At compilation with <code>gcc -o test test.c</code> it gives an error</p>
  
  <p><code>test.c: In function ‘main’:<br>
  test.c:6: error: too many arguments to function ‘random’</code></p>
  
  <p>As far as I know the function <code>random()</code> only takes one argument which is an integer to determine the range of the numbers given. What am I doing wrong?</p>
  
  <p>EDIT: It seems that those correspond to some TurboC old things. So the question is now, how to make "truly" random integers in the sense that they are not skewed? My approach is (as suggested by Vatine)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(){
    srand(time(NULL));
    printf("%d\n",rand()/(RAND_MAX/100));
    return 0;
  }
  </code></pre>
  
  <p>which seems to yield a correct result. Is this adding some bias or the results have at least equal probability of falling into any of the numbers in the range?</p>