home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!utcsri!torn!maccs!rickan
- From: rickan@maccs.dcss.mcmaster.ca (Mark Rickan)
- Subject: Initializing Random Seeds
- Message-ID: <1992Sep4.173259.12437@maccs.dcss.mcmaster.ca>
- Organization: Department of Computer Science, McMaster University
- Date: Fri, 4 Sep 1992 17:32:59 GMT
- Lines: 18
-
- Please excuse me if this is a FAQ, but is there a ANSI-compliant means
- of initializing a random seed which has a reasonably low probability
- of recurring? At the moment, I'm using srand in conjunction with
- time(&t). Unfortunately, on a fast machine, the time delay is often
- < 1 second, resulting in the production of the same random value.
-
- I've avoided this problem by use of a time delay, but I'm convinced
- that there must be a more elegant and efficient means of doing this.
-
- Any suggestions would be appreciated,
-
- Mark
-
- --
- -------------------------------------------------------------------------
- = Mark Rickan ...!uunet!utai!utgpu!maccs!rickan =
- = DCSS, McMaster University rickan@maccs.dcss.mcmaster.ca =
- -------------------------------------------------------------------------
-