Date: Thu, 21 Nov 1996 17:00:43 +0200 (IST) From: Eli Zaretskii To: "Alexander V. Lukyanov" Cc: djgpp AT delorie DOT com, fighteer AT cs DOT com, mad AT grupo DOT bfe DOT pt, DJ Delorie Subject: Re: Problems with djgpp 2.01 In-Reply-To: <199611211143.OAA06514@video.yars.free.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 21 Nov 1996, Alexander V. Lukyanov wrote: > I don't know if it is declared in a standard, but I think rand() > should always return the same sequence if srand is not used. > Of course, I can do srand(0), but usually I don't have to. ANSI C says that `rand' will always generate the same sequence if `srand' is not called before the first call to `rand'. It also specifies that the above default sequence should be the same as if `srand' was called with a seed value of 1. This means that the DJGPP implementation does not conform to this last requirement, since it generates a sequence as if `srand' was called with a seed of 0.