--- 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?
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/