Date: Thu, 24 Apr 1997 14:43:07 +0300 (IDT) From: Eli Zaretskii To: a DOT phillips AT bohm DOT anu DOT edu DOT au cc: djgpp AT delorie DOT com Subject: Re: Help: Using the clock to seed srand() In-Reply-To: <335C6DB3.39D@student.anu.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 22 Apr 1997, Alistair Phillips wrote: > I have declared clock as > > unsigned int clock = (unsigned int *)0x0000046CL; > > then I call it > > srand(*clock); > > it compiles and links OK but when I run it I get a huge error message You are using real-mode tricks in a protected-mode program, which is why your program crashes. You can't access absolute addresses in that way, because protected mode doesn't allow that. Please read the DJGPP FAQ list, section 18.4, for an explanation of how to do that in DJGPP. The FAQ is available as v2/faq210b.zip from the same place you get DJGPP.