0_0_17880769_27031.cpp: In function 'void bfs(int, int)': 0_0_17880769_27031.cpp:38:49: error: 'ans' was not declared in this scope if(pic[tx][ty] == 'r' && t.setp+1 < ans) { printf("%d\n", t.setp+1); return; } ^