I'll give you a sample:

Code:
maze[20][20]; //Predefined maze array

if( GetKeyState(VK_LEFT) ) //However you do it in C
{
  if( CharacterPosition & 0x08 ) //Character position is a maze[][] spot
    MoveCharacterLeft();
}