home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 13233 < prev    next >
Encoding:
Text File  |  1992-09-04  |  1.1 KB  |  28 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!utcsri!torn!maccs!rickan
  3. From: rickan@maccs.dcss.mcmaster.ca (Mark Rickan)
  4. Subject: Initializing Random Seeds 
  5. Message-ID: <1992Sep4.173259.12437@maccs.dcss.mcmaster.ca>
  6. Organization: Department of Computer Science, McMaster University
  7. Date: Fri, 4 Sep 1992 17:32:59 GMT
  8. Lines: 18
  9.  
  10. Please excuse me if this is a FAQ, but is there a ANSI-compliant means
  11. of initializing a random seed which has a reasonably low probability
  12. of recurring? At the moment, I'm using srand in conjunction with
  13. time(&t). Unfortunately, on a fast machine, the time delay is often
  14. < 1 second, resulting in the production of the same random value.
  15.  
  16. I've avoided this problem by use of a time delay, but I'm convinced
  17. that there must be a more elegant and efficient means of doing this.
  18.  
  19. Any suggestions would be appreciated,
  20.  
  21. Mark
  22.  
  23. -- 
  24.  -------------------------------------------------------------------------
  25.  = Mark Rickan                         ...!uunet!utai!utgpu!maccs!rickan = 
  26.  = DCSS, McMaster University               rickan@maccs.dcss.mcmaster.ca = 
  27.  ------------------------------------------------------------------------- 
  28.