Message-Id: <2.2.32.19970305155059.006a8c1c@mailhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 05 Mar 1997 13:50:59 -0200 To: djgpp AT delorie DOT com From: Eyal Ben-David Subject: Re: DJGPP random numbers >Sorry for asking that stupid question, but can anybody tell me how i can >get random numbers from 0 to 255? > >Do i have to call something like a randomize timer function like in >Borland? > random_number_0_to_255 = rand() % 256; the declaration for rand() is in stdlib.h It is usually good to seed the random number generator. Otherwise it would create the same sequence of "random" numbers every time. You can do it at the begining of your program for example: time_t now; now = time(NULL); /* or: time(&now); srand(now); Eyal.