title: Generating random non repeating number array in C++
body: <p>I need to generate random non repeating number array in C++, in this part of code I generate random numbers using, srand function, but some of the numbers are repeating. The main task is to generate random numbers for lottery ticket, so I need to generate numbers until golden number which is marked as int golden.</p>
  
  <blockquote>
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;ctime&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
    int golden = 31;
    int i = 0;
    int array[35];
  
   srand((unsigned)time(0));
      while(i != golden){
          array[i] = (rand()%75)+1;
          cout &lt;&lt; array[i] &lt;&lt; endl;
          i++;
  }
   }
  </code></pre>
  </blockquote>