I've been playing around a bit and I've done a program that plays the lottery (EuroMillions), and I was able to do it.
I got four arrays, two for the numbers and two for the stars, and then I'd sort both so I could more easily compare them.
So here's my question, can I sort only the first five numbers and then the last two, separately? Or do I really need to have four arrays like I did?
What I used to sort:
int cmpfunc (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}
and
qsort(b, 7, sizeof(int), cmpfunc);
If the code is needed I can post it, but it's rather big.