title: How to use std::normal_distribution
body: <p>I am an experienced C programmer that is occasionally forced to use a little bit of C++.</p>
  
  <p>I need to generate random numbers from a normal distribution with a variety of means and variances. If I had a C function that did this called <code>normal(float mean, float var)</code> then I could write the following code:</p>
  
  <pre><code>int i;
  float sample;
  for(i = 0;i &lt; 1000;i++)
  {
    sample = normal(mean[i],variance[i]);
    do_something_with_this_value(sample);
  }
  </code></pre>
  
  <p>Note that there is a different mean and variance for each value of i.</p>
  
  <p>C does not contain a function called normal, but C++ does, well actually its called std::normal_distribution. Unfortunately my C++ is not good enough to understand the syntax in the documentation. Can anyone tell me how to achieve the functionality of my C code but using std::normal_distribution.</p>