title: C++ random number generator without repeating numbers
body: <p>I have searched high and low for a type of function that turns this code</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt; 
  #include &lt;stdlib.h&gt; 
  #include &lt;time.h&gt; 
  
  using namespace std;
  
  void ran(int array[], int max);
  int main() {
   printf("Today's lottery numbers are:\n");    
   for (int i = 0; i &lt; 6; i++)
    srand((unsigned)(NULL));
  }
  </code></pre>
  
  <p>into a random number generator that ensures no repeating numbers can someone help me with it? after the check I plan to print it with <code>printf("%d\n", rand()%50);</code> </p>
  
  <p>I just need a routine that makes sure its non repeating.  Please If you can give me a routine I would be greatly relieved and will be sure to pay it forward. </p>
  
  <p>Thanks.  The libraries don't seem to be reading right on this scren but they are stdio, stdlib and time and im using namespace.</p>