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

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -