A lottery with arrays-displaying matching digits.

Pages: 12
I don't know why you insisted this new variable to be an array

What? The only time I said to use a new array was if you needed to keep track of the numbers that matched, not the amount of them.

Anyway, it looks like what you have should work for now. You still have other problems like seeding the random number generator inside a loop, but that should not effect how this program works.
what do you mean by "seeding the random generator inside a loop". All the winning numbers have been random. Each iteration has given me random numbers. I'm sorry if I'm not understanding what you meant by that quote. If you could, please explain further. Oh, and sorry about the statement that I made. Also, what other problems?



Yes, it is working this time, but the random number generator only needs to be seeded once. You are reseeding it every time through the loop. It is best to seed it at the start of main or after declaring variables. I have written simple programs using string without including it that worked, until I added more to it that is. Just because it works does not mean it is right.

I do not remember off hand other problems and some or all of it might have simply been more a matter of style. The random number generator was the main one.
Topic archived. No new replies allowed.
Pages: 12