Mail Archives: djgpp/1999/10/08/23:18:23
> 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 -