Date: Tue, 21 Oct 1997 21:00:33 -0400 (EDT) From: "H. Anthony Hoyt" To: Mark Phillips Cc: djgpp AT delorie DOT com Subject: Re: Trouble with bools In-Reply-To: <62irr4$chm$1@postern.mbnet.mb.ca> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk Little know fact (well, not really) is that you can initalize your array as follows.. bool scrn[640][480] = {0}; You could initalize every variable this way as well (Even 2D, 3D... nD arrays) by just putting a comma (,) after ever variable. Ex. bool foo[2][3] = { 0, 1, 0, 1, 0, 1}; (although most people tend to do the following to make it easier to visualise) bool foo[2][3] = { 0, 1, 0 1, 0, 1}; (Could someone tell me if I'm wrong but I think this is possable.) Note though, by default if you initalize one variable of the array but not the rest, the rest get set to 0 (zero). So.... bool foo[2][3] = {1}; only sets the first item of the array to 1 but the rest to 0. As for how efficent (sp) this is, I don't know. There could very well be some un desireable affects to this (which I would love to know myself) but it works. As for you current problem, I have no idea why it's not looping properly. Is what you posted an exact code snip? How about walking though it with rhide? Tony May you find strength in magic -- RavenHart @}->--'--,--- On Tue, 21 Oct 1997, Mark Phillips wrote: > why won't this work? > > [code snipped] > > bool scrn[640][480]; > > [more code snipped] > > // initialize scrn: > for (int i=0; i<640; i++) > for (int j=0; j<480; j++) > scrn[i][j]=0; > > it never seems to leave the loop, what did i do wrong? > > also, is this kind of question meant for a c++ group or is it ok to > post here? > > mark phillips > >