>From: Mickey Mathieson <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: Re: [c-prog] confused with struct?
>Date: Thu, 22 Mar 2007 13:47:24 -0700 (PDT)
>
>
>--- GLOGIC 20 <[EMAIL PROTECTED]> wrote:
>
> >
> >
> >
> > >From: Mickey Mathieson <[EMAIL PROTECTED]>
> > >Reply-To: [email protected]
> > >To: [email protected]
> > >Subject: Re: [c-prog] confused with struct?
> > >Date: Thu, 22 Mar 2007 11:35:09 -0700 (PDT)
> > >
> > >
> > >--- glogic_1 <[EMAIL PROTECTED]> wrote:
> > >
> > > > Hey all
> > > > K this is the problem.. I have a
> > CaveArray[][]made
> > > > up of the
> > > > following struct. when i refer to the bool
> > members
> > > > of it to test if
> > > > it is true or false it always skips the code
> > > > following.
> > > >
> > > > struct cave {              //template of each
> > cave
> > > >         bool North ;
> > > >         bool South ;
> > > >         bool East ;
> > > >         bool West ;
> > > >         bool Wumpus ;
> > > >         bool NewWumpus;
> > > >         bool Hole ;
> > > >         bool Arrows ;
> > > >         bool Lives ;
> > > >         bool CaveFound;
> > > >
> > > >
> > > >
> > > > } CaveArray [IROW][ICOL] ;
> > > >
> > > > e.g.
> > > > if ( Maze[iX][iY].North == true )
> > > > {
> > > >                 if ( Maze[iX-1][iY].Hole == true
> > )
> > > >                 //even though this expression is
> > > > true it never goes
> > > > into the following code it just skips on.. ive
> > put
> > > > watches on all
> > > > the CaveArray and stepped through the code and
> > then
> > > > the expression
> > > > is highlighted it says its true but still skips
> > the
> > > > code anyway
> > > >                 {
> > > >                         bHole = true;
> > > >                 }
> > > > }
> > > > iX and iY are always within the array size
> > > >
> > > > any ideas why this is??
> > > > Cheers
> > > > g
> > > >
> > > >
> > >
> > >Is BHole being referenced anywhere in the program?
> >
> > at the start of the function i declare bHole as
> > being false. then if
> > Maze[iX-1][iY].Hole == true i flag bHole as being
> > true. which is used later
> > in the function to output the relevent txt to the
> > screen.
> > It is used later in the code so that would mean that
> > the problem is not
> > because its being optimized right? im using borland
> > builder 6 and that warns
> > when there are unsued variables but im getting no
> > warnings either
> >
>
>Try placing a printf or MessageBox(depending on
>program type) in the code block and see if it gets
>invoked.
>
>Make sure optimization is off - its on the option page
>for borland 6.0 IDE.


hey Mickey
Yeah i already tried putting outputs in the code block to see if it worked 
but nothing was output
and i just checked that optomization thing u were talking about and its set 
to none
i asked lecturer today what the problem was and he couldnt work it out 
either so he just walked away after awhile!
thanks for the help
g
>
>Mickey
>
>
> > >
> > >I would suspect that bHole is being optimized out
> > of
> > >the code because its of no use to the program.
> > >
> > >If the program below is optimized it will exclude
> > the
> > >second code block.
> > >
> > >
> > >int main()
> > >{
> > >  bool a = true;
> > >  bool b = true;
> > >  bool c = true;
> > >
> > >   if (a)
> > >   {
> > >           if (b)
> > >           {
> > >            bvalue = true;
> > >           }
> > >   }
> > >
> > >   return 0;
> > >}
> > >
> > >try turning off optimization or reference bHole
> > >somewhere in the program.
> > >
> > >
> > >
> > >Mickey M.
> > >Construction Partner Inc.
> > >http://www.constructionpartner.com
> > >
> > >
> > >
> >
> >____________________________________________________________________________________
> > >Looking for earth-friendly autos?
> > >Browse Top Cars by "Green Rating" at Yahoo! Autos'
> > Green Center.
> > >http://autos.yahoo.com/green_center/
> >
> >
>_________________________________________________________________
> > 5.5%* 30 year fixed mortgage rate. Good credit
> > refinance. Up to 5 free
> > quotes - *Terms
> >
>https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h2a5d&s=4056&p=5117&disc=y&vers=910
> >
> >
>
>
>
>
>____________________________________________________________________________________
>Now that's room service!  Choose from over 150,000 hotels
>in 45,000 destinations on Yahoo! Travel to find your fit.
>http://farechase.yahoo.com/promo-generic-14795097

_________________________________________________________________
The average US Credit Score is 675. The cost to see yours: $0 by Experian. 
http://www.freecreditreport.com/pm/default.aspx?sc=660600&bcd=EMAILFOOTERAVERAGE

Reply via email to