title: Generating random numbers in C
body: <p>While searching for Tutorials on generating random numbers in C I found <a href="https://stackoverflow.com/questions/160890/generating-random-numbers-in-objective-c">this topic</a></p>
  
  <p>When I try to use the <code>rand()</code> function without parameters, I always get  0. When I try to use the <code>rand()</code> function with parameters, I always get the value 41. And whenever I try to use <code>arc4random()</code> and <code>random()</code> functions, I get a LNK2019 error.</p>
  
  <p>Here's what I've done:</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  int main()
  {
    int x;
    x = rand(6);
    printf("%d", x);
  }
  </code></pre>
  
  <p>This code always generates 41. Where am I going wrong? I'm running Windows XP SP3 and using VS2010 Command Prompt as compiler.</p>