Random non repeating Number generator

Apr 21, 2012 at 5:28pm
Hi, Everyone.
Can you please help me here. I need to create a program that ask the user how many numbers to generate(Range 1-20) as well as ask for a file for storing them(fstream). I can do this but but, they repeat e.g 14 14 14 14etc....
Please help guys.
Apr 21, 2012 at 5:34pm
Well, you need to show the code...
if I had to guess, you're calling srand every iteration.
Apr 21, 2012 at 10:14pm
without the use of srand, I think it is loop involvement.
I am sorry that I cant show the code, I am having problems with the browser here in this location.
Topic archived. No new replies allowed.