title: C++ simple array creation with user given length
body: <p>How to create one array in a method with user given length? I would like to fill in a vector with user given length with random numbers.</p>
  
  <pre><code> double* Random::quasiRandomUnif(float a, float b, int NN) 
   {
       int i, errcode;
  
            N_=NN; // here initialize the member N_
  
            float r[N_];
  
       VSLStreamStatePtr stream;
       int i, errcode;
  
       errcode = vslNewStream( &amp;stream, BRNG,  SEED );
       errcode = vsRngUniform( METHOD, stream, N_, r, a, b );
  
       double* rd = new double[m_N];
       for(int i=0;i&lt;m_N;i++)
           rd[i]=(double)r[i];
  
       errcode = vslDeleteStream( &amp;stream );
  
       return rd;
    }
  </code></pre>
  
  <p>I thought of N_ a member for the class Random, to be initialized in this function's body, with some user given value -- not possible, since space allocated in array should be a constant. How to deal with?</p>
  
  <p>Kind regards.</p>