I\'m a C++ newbie and I\'m stumped on this. I need to call this function in my main function three times but each time it gives me the same result, i.e. pull_1, pull_2, pul
You shouldn't call srand() before each call to rand(). Call it once – somewhere at the start of your program.
srand()
rand()
The problem is you restart the random generator so it starts to produce the very same pseudorandom sequence from the very same point.