[Solved] C++ random function return same numbers [duplicate]

[ad_1]

Your forgot to ad

#include <ctime>
srand(time(NULL)) 

at the start of your program.

This will generate a new seed everytime you run your program based on the current time.

1

[ad_2]

solved C++ random function return same numbers [duplicate]