so im basically new at c++.
i need to generate 20 entries randomly from 1-20, and each number must be unique.
i was able to generate the number but i don't know how to make them unique.
any suggestions?
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <math.h>
using namespace std;
int array[20];
int main ()
{
srand(time(NULL));
for (int i=0; i<20; i++)
{
int x;
x=rand()%20+1;
cout << array[0]<<x<< " ";
}
return 0;
}