I am stuck on the move part of fifteen and trying to learn how to use GDB. My thought process for moving is to search for the "tile" and if the tile is adjacent to the "_" then switch. during GDB, i would like to print out the grid number it is currently on but why if i type " P Grid", it would result in 0x7ffffffffddb0? Thanks in advance.
bool move(int tile)
{
int grid[d][d];
int blank = 0;
for (int row = 0; row < d; row++)
{
for (int column = 0; column <d; column++)
{
if (grid[row][column] == tile)
{
if (grid[row+1][column] == blank)
{
int temp = grid[row+1][column];
grid[row+1][column] = grid[row][column];
grid[row][column] = temp;
}
else
return false;
}
}
}