delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/08/23:18:23

From: Nicolas Blais <nicblais AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Please help...matrix problem with Allegro
Date: Sat, 09 Oct 1999 02:07:01 GMT
Organization: Deja.com - Before you buy.
Lines: 62
Message-ID: <7tm800$inr$1@nnrp1.deja.com>
References: <DB85AFBE7C0DD311BF260004ACB80BFCEC34 AT nex_server DOT nextransport DOT com> <7tln9o$6ue$1 AT solomon DOT cs DOT rose-hulman DOT edu>
NNTP-Posting-Host: 142.169.188.171
X-Article-Creation-Date: Sat Oct 09 02:07:01 1999 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
X-Http-Proxy: 1.1 x29.deja.com:80 (Squid/1.1.22) for client 142.169.188.171
X-MyDeja-Info: XMYDJUIDnicblais
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> Provided your matrix is of chars. A more general method:
>
> memset(matrix, 0, sizeof(matrix));
>
>

Thanks but it STILL doesn't work.  Here's what symify tells me:

Shutting down Allegro
Exiting due to signal SIGSEGV
Stack Fault at eip=00002399
eax=00000000 ebx=001191df ecx=49edf742 edx=16e7bc99 esi=00000054
edi=00099204
ebp=001191c0 esp=fffed1b4 program=C:\DJGPP\PROJECTS\ILLIS\MAIN.EXE
cs: sel=0227  base=85e8b000  limit=0013ffff
ds: sel=022f  base=85e8b000  limit=0013ffff
es: sel=022f  base=85e8b000  limit=0013ffff
fs: sel=023f  base=00000000  limit=0010ffff
gs: sel=023f  base=00000000  limit=0010ffff
ss: sel=022f  base=85e8b000  limit=0013ffff
App stack: [00119204..00099204]  Exceptn stack: [000990e4..000971a4]

Call frame traceback EIPs:
  0x00002399   _run_program__Fv+9, line 48 of main.cpp

And line 48 is indicated:
PLEASE HELP!


ushort run_program()
{
ushort pix_x;
ushort pix_y;
ushort color_red;
unsigned int matrix[res_x][res_y];
memset(matrix, 0, sizeof(matrix));  //line 48

for (unsigned int i = 0; i < (res_x * res_y); i++)
     {
     if (keypressed())
        break;
     pix_x = (random() % res_x);
     pix_y = (random() % res_y);
     if (matrix[pix_x][pix_y] == 1)
        continue;
     else
          matrix[pix_x][pix_y] = 1;
     color_red = (random() % 255) + 1;
     putpixel(screen, pix_x, pix_y, RGB(color_red, 0, 0));
     }
return 1;
}

--
nicblais AT hotmail DOT com
Powered by FreeBSD!
http://www.freebsd.org


Sent via Deja.com http://www.deja.com/
Before you buy.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019