The
rand
function will constantly return the same sequence of random numbers. This is convenient only at the debugging stage. In order for the sequence to be different all the time, when starting the application, you need to specify seed - this is achieved by calling
srand
. See
srand().
Login in to like
Login in to comment