From: Nicolas Blais Newsgroups: comp.os.msdos.djgpp Subject: Re: random under djgpp Date: Fri, 23 Oct 1998 07:28:21 -0400 Organization: Alpha Quark Technologie Lines: 20 Message-ID: <36306854.93ACE66A@phreaker.net> References: <70osqi$49k$1 AT news DOT kren DOT nm DOT kr> NNTP-Posting-Host: ts1-40.f2001.quebectel.com Mime-Version: 1.0 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5b2 [en] (Win95; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com You first have to randomize the numbers, or else you will always have the same.
srandom(time(NULL));
int x = (random() % 260)+ 1;

This is an example of getting a number between 1 and 260.  The srandom acts like the RANDOMIZE in Basic.  It's seed is time so always changes.

Nicolas Blais

big choi wrote:

Hi
i don't know..get random number..
i write "int x=random(260)" under turbo c..
i'd like to get between 0 and 260..
help me plz.. what to write.. under djgpp??
email supercms AT netian DOT com
thanks..