From owner-freebsd-questions@FreeBSD.ORG Mon Jun 16 09:51:28 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCC4437B401 for ; Mon, 16 Jun 2003 09:51:28 -0700 (PDT) Received: from mailout.informatik.tu-muenchen.de (mailout.informatik.tu-muenchen.de [131.159.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3569743F3F for ; Mon, 16 Jun 2003 09:51:28 -0700 (PDT) (envelope-from barner@in.tum.de) Received: by zi025.glhnet.mhn.de (Postfix, from userid 1000) id A102038021; Mon, 16 Jun 2003 18:51:26 +0200 (CEST) Date: Mon, 16 Jun 2003 18:51:26 +0200 From: Simon Barner To: "Jack L. Stone" Message-ID: <20030616165126.GB529@zi025.glhnet.mhn.de> References: <3.0.5.32.20030616111517.0137e538@sage-one.net> <20030616164242.GA529@zi025.glhnet.mhn.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030616164242.GA529@zi025.glhnet.mhn.de> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at informatik.tu-muenchen.de cc: freebsd-questions@freebsd.org Subject: Re: Running a rand or random script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 16:51:29 -0000 Whoops, did too much C++ programming these days, in C this should really be: #include #include int main (int argc, char *argv[]) { unsigned int r; srandomdev(); /* use this on non-BSD systems: srandom(time (0)); */ r = random () % 99999 +1; printf ("%d\n", r); return r; }