On Thu, 3 Oct 2002, Nikhil Joshi wrote:
> i guess it has something to do with seed (what is it anywayz ?) when i
> call srand with different seed value it gives some other integer, but
> again it *always* gives that integer only..
one generally calls srand with the current timestamp.
remember, one cannot generate random numbers by deterministic means. a
classical computer is a deterministic engine and therefore *cannot*
generate random numbers. They generate pseudo random numbers based on a
randomising function (see Knuth). The function is dependent on the seed
being sufficiently random. Picking the current millisecond value is a
good choice.
Philip
--
They have been at a great feast of languages, and stolen the scraps.
-- William Shakespeare, "Love's Labour's Lost"
_______________________________________________
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers