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

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -