Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!rg2c+ From: rg2c+@andrew.cmu.edu (Robert Nelson Gasch) Newsgroups: comp.sys.mac.programmer Subject: Strange srand() behavior Message-ID: Date: 31 Jan 91 05:41:13 GMT Organization: Class of '91, Carnegie Mellon, Pittsburgh, PA Lines: 16 When I use the values GetDateTime() or Delay() return to initialize srand(), I constantly get the same random number combinations every time I call srand(), even though the value I pass into srand() changes. This piece of code is what I do: unsigned long int seed; GetDateTime (&seed); or Delay (0, &seed); srand (seed); If I call this, lets say, 5 times within a minute or so, I get the same series of random numbers every time. The series I get with GetDateTime () never changes, while the series I get when using Delay () to provide the seed changes only if I reboot. Any suggestions on what causes this strange behavior? Thanx again --> Rob