#include <time.h>
#include <stdlib.h> // or wherever srand and rand live
srand (time (0));
It will initialize the random number based on the current time. So unless you have a battery that is not working, and run the same sequence with the same timing everytime, you will get a different seed.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.