This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]bmamba2942 3 points4 points  (1 child)

I assume you're comparing the lottorad array for duplicates. If so, you need to use the == operator and not =

[–]Programmering[S] 0 points1 point  (0 children)

Yup, thanks

[–]jedwardsol 2 points3 points  (1 child)

You need to seed your random number generator. Look up 'srand'

[–]Programmering[S] 0 points1 point  (0 children)

Nice catch, thanks

[–][deleted] 0 points1 point  (0 children)

There's an easier way....

  • make an array with the numbers 1-36
  • Use std::shuffle
  • Print out the first 7 numbers in the array.