srand() generates a seed (which is the number used to initialize the random number generator) and must be called once per process. rand() is the function you are looking for.
If you don't know what seed to pick, use the current time:
srand(static_cast(time(0))); // include to use time()