www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/20/06:30:14

Date: Thu, 20 Jun 1996 13:25:34 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Nathan Kopp <nkopp AT grfn DOT org>
Cc: djgpp AT delorie DOT com
Subject: Re: How to get a good value for srand?
In-Reply-To: <4q9png$1u4@newsserv.grfn.org>
Message-Id: <Pine.SUN.3.91.960620132349.21348C-100000@is>
Mime-Version: 1.0

On 19 Jun 1996, Nathan Kopp wrote:

> How do I get a good value for srand()???  Timer functions like rawclock() 
> are no good because they are always zero the first time you call them.  

The usual way to do this is by calling `time':

	#include <stdlib.h>
	#include <time.h>
	srand ((int)time ((time_t *)0));

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019