using the time function for srand in pseudo-random number generator in c -
#include <time.h> ((unsigned)time(null));
i don't understand why have include time header file , use time function in program when creating pseudo-random number generator using function srand(). can please explain significance of time in case?
* please note code shown part of program. thank you.
it makes code non-repeatable when called second time. if include no seed or fixed number seed, program act same, because random number same.
Comments
Post a Comment