Date: Wed, 13 Oct 1999 13:15:34 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Nicolas Blais , djgpp AT delorie DOT com Subject: Re: Please help...matrix problem with Allegro In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sat, 9 Oct 1999, Nicolas Blais wrote: > ushort pix_x; > ushort pix_y; > ushort color_red; > unsigned int matrix[res_x][res_y] = {{0}}; I probably should have seen this sooner, but the incomplete source didn't help: you are declaring a large automatic array, and it overflows the run-time stack. matrix[res_x][res_y] is declared int, so each element takes 4 bytes. 640*480*4 is *way* more than 512K bytes, the size of the run-time stack allocated by the startup code. Section 15.9 of the FAQ describes the two ways you can use to enlarge the stack. But I suggest to make your matrix either a static array (outside of any function) or to allocate it at run time by a call to malloc.