🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.os.msdos
Article #80

Re: un generateur de nombre aleatoire sous DOS

#80
From: S�bastien WILLEMIJNS
Date: Thu, 21 Jul 2005 14:55
46 lines
2523 bytes
On Thu, 21 Jul 2005 10:49:59 +0200, AG <ag@tb.fr> wrote:

>#include <stdio.h>
>#include <stdlib.h>
>#include <time.h>
>
>
>int main(int argc, char * argv[])
>{
>         int a = atoi(argv[1]);
>         int b = atoi(argv[2]);
>         int c = a>b ? a:b;
>         int d = a<b ? a:b;
>
>         if(argc!=3) printf("usage : hazard.exe n1 n2");
>         srand(time(NULL));
>         printf("%d\n",(int)(((double)rand())/RAND_MAX*(c-d)+0.5)+d);
>         return 0;
>}

merci de ton petit programme mais il crash avec le gcc de cygwin
je suis a l'instant en train de recuperer la 4.01 de GCC puis j'irais
me battre avec les bz2 pour essayer de recuperer les binaires compil�s
:)

Exception: STATUS_ACCESS_VIOLATION at eip=610C5FD0
eax=0073F144 ebx=00000000 ecx=00000000 edx=00000000 esi=00401050
edi=0000000A
ebp=0073ECD8 esp=0073ECC0 program=C:\GCC\BIN\GCD.EXE, pid 357129,
thread main
cs=016F ds=0177 es=0177 fs=4C07 gs=0000 ss=0177
Stack trace:
Frame     Function  Args
0073ECD8  610C5FD0  (0073F144, 00000000, 00000000, 0000000A)
0073ECF8  610C6158  (00000000, 00000000, 0000000A, 610042FE)
0073ED18  610C20C0  (00000000, 610E21A0, 00000000, 00401075)
0073ED68  0040108A  (00000001, 00B90200, 00B90090, 610A5E22)
0073EE58  61004DD2  (0073EE70, FFFFFFFF, 00000000, 00000000)
0073FE08  6100594F  (00000000, 00000000, 00000000, 00000000)
End of stack trace


-- 
S�bastien WILLEMIJNS, France
www.willemijns.com
www.nntpeng.willemijns.com (FAQ about open NNTP servers)
Technical Details
Message-ID: <dbod0h$1hnu$1@talisker.lacave.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.agarik.com!usenet-fr.net!freenix!talisker.lacave.net!lacave.net!not-for-mail
References: <dbmgem$2378$1@talisker.lacave.net> <42df5f16$0$22531$636a15ce@news.free.fr>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10f688,1b9cd5f314610f29
X-Google-Thread: f9822,1b9cd5f314610f29
X-Google-Attributes: gid10f688,gidf9822,public
X-Google-Language: FRENCH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.agarik.com!usenet-fr.net!freenix!talisker.lacave.net!lacave.net!not-for-mail
From: S�bastien WILLEMIJNS <sebastien@willemijns.com>
Newsgroups: fr.comp.os.msdos,fr.comp.lang.c
Subject: Re: un generateur de nombre aleatoire sous DOS
Date: Thu, 21 Jul 2005 16:55:04 +0200
Organization: Service de news de lacave.net
Lines: 46
Message-ID: <dbod0h$1hnu$1@talisker.lacave.net>
References: <dbmgem$2378$1@talisker.lacave.net> <42df5f16$0$22531$636a15ce@news.free.fr>
NNTP-Posting-Host: 84.4.8.197
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: talisker.lacave.net 1121957714 50942 84.4.8.197 (21 Jul 2005 14:55:14 GMT)
X-Complaints-To: abuse@lacave.net
NNTP-Posting-Date: Thu, 21 Jul 2005 14:55:14 +0000 (UTC)