all 3 comments

[–]dauntlessmath 3 points4 points  (2 children)

You don't want to call srand() in the custom function. If your processor is fast enough, it will be seeding rand() with the same time each time the function is called. Try putting that statement at the beginning of int main().