title: about vector in c++
body: <p>i wanna make a function that generates a list of random numbers with a size inserted by the user to apply some sorting algorithms on these randoms why this code doesn't run ..plz help</p>
  
  <pre><code>vector&lt;int&gt; DataList; 
  
  int GenerateRandomList(int min, int max, int size)
  {
      srand ( time(NULL) );
      for(int i=0;i&lt;size;i++)
      {
          DataList[i]=rand()% max+min;
          cout&lt;&lt;DataList[i];
          cout&lt;&lt;endl;
      }
  }
  </code></pre>