From: Spiritseeker Newsgroups: comp.os.msdos.djgpp Subject: Re: How come there are five "4" in the array, when i only set four!? Date: Wed, 31 Dec 1997 05:18:08 +0100 Organization: A customer of Tele2 Lines: 32 Message-ID: <34A9C780.4D0@geocities.com> References: <34A8599C DOT 45D AT geocities DOT com> <5GefBIAU2Rq0Iw3V AT sunholme DOT demon DOT co DOT uk> NNTP-Posting-Host: mn8.swip.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cache-Post-Path: mn8!s-23470 AT dialup169-2-54 DOT swipnet DOT se To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk > Inside the constructor... > > > /* clear the array */ > > for(y=0;y > for(x=0;x > *(tile_data + (y * Y_SIZE) + x) = 0; > > Each line is X_SIZE in width... so why are you multipling the Y > coordinate by the number of lines (Y_SIZE) rather than the width of each > line? (X_SIZE) :-) Oh.. OH.. OH... (font_size += 9.87654321) *OH* heh, man.. why is the obvious always so !obvious. 8-) > > for(y=0;y for(x=0;x printf("%d",*(tile_data+(y*X_SIZE)+x)); > }// ^^^^^^^^ <--- note! > printf("\n"); > } Okay, got it =) > > As an alternative approach, which would leave out all that > which has the advantage of being much easier to read! > Thank you!, /Jonas