Lottery program (ascending order & non-repeating numbers)

So in the program the person can choose how many rows they want.
The program should then give out 7 random numbers (between 1-35) per row.
The problem im having is ascending them in order and making them non-repeating. They can repeat on other rows but not on the same row. Any kind of help on how to do it.(I used this but for some reason it didnt work: http://i.imgur.com/ad5FeX0.png )

Im using rand / srand to make the numbers "random".

Thanks in advance for the help! :)
Easiest option would be to use a std::set<int>.
In this way the numbers are automatically sorted and unique.
http://www.cplusplus.com/reference/set/set/
Thank you, i'll try it! :)
Last edited on
Topic archived. No new replies allowed.