I posted a short part of my code down here.
What I'm intending to do is to try to get the function
to produce 52 non recurring numbers.. From what I
heard, I have to create an array, and check against it
However, i am not really good with arrays, so I would
require some help at this part. From what I have
already in the code, what can be modified to get something
more like what I want?
I need to know how to do the "checking the array for already
existent numbers" part. How can it be done? :)
int random_integer;
int array[52];
int main()
{
srand((unsigned)time(0));
for(int index=0; index<52; index++)
{array[index] = (rand()%51)+1;
cout << array[index] << endl;}
system ("pause");
}
Thank you so much people!
(P.S. Give me some code to work with ^^)
Tags: