I've just read te book The art of debugging with GDB, DDD and Eclipse, but I just can't find out what I'm doing wrong:
I'm using DDD i've set a breakpoint at the first for loop. Then I fill in at the properties of the breakpoint the expression : won if i==2 and click apply
I just get a message : junk at the end of expression
Code:
bool
won(void)
{
int prevpos = 0;
int count = 0;
for (i = 0 ; i <= d -1 ; i++)
{
for (j = 0 ; j <= d -1; j++)
{
prevpos = board[i][j];
if(board[i][j] < prevpos )
count++;
if (count == (d*d)-1)
return true;
}
}
return false;
}
hopefully someone can shed a light on this.