title: C++ Generating random vector
body: <p>I'm just starting out, trying to learn to program. So I'm programming in C++ for now, and I tried to create a function that will generate a vector of random integers based on the parameters. So my function so far looks like this:</p>
  
  <pre><code>std::vector&lt;int&gt; GenerateRandomVector(int NumberCount,int minimum, int maximum) {
      std::vector&lt;int&gt; vecRandomValues;
      int i = 0, randValue = 0;
      srand(time(NULL));
      while (i &lt; NumberCount) {
          randValue = rand() % maximum + minimum;
          vecRandomValues.push_back(randValue);
          i++;
      }
      return vecRandomValues;
  }
  </code></pre>
  
  <p>So, my problem is that it does not respect the minimum and maximum value I give it, and also most of the time, 40% of the generated numbers are 0. I cannot figure out what I did so wrong here, nor do I have any idea on how to fix it. I'm using Clion on Windows 10.</p>