I have a program to randomly pick 90 questions from a large database(295), so what I did is made an index array of ints of ints labelled 1-90, but I want the array to not have duplicates.
theres a little snippit.Code:srand(time(0)); for(int i=0;i<MAXQ;i++) randoms[i] = rand()%295;
I then sort the random array, but I get duplicates of an index. How can I arrange 295 questions into 90 but without duplicates?
Thanks



LinkBack URL
About LinkBacks



I used to be an adventurer like you... then I took an arrow to the knee.