I have this little pieace of code
class MazeClass{
public:
void printMaze(){
for (int y=0; y<N;y++){
cout <<Map[y]<<endl;
}
}
void moveMe(){
if (GetAsyncKeyState(VK_UP) !=0){
if ((Map[myLocation[0]][myLocation[1]-1])) ==' '){
Map[myLocation[0]][myLocation[1]]) =' ';
Map[myLocation[0]][myLocation[1]-1]) ='@';
myLocation[1]--;
}
}
}
private:
char Map [N][N+1] = {"##########",
"#@ #",
"# #",
"# #",
"# #",
"# #",
"# #",
"# #",
"# #",
"##########"};
int myLocation[2]={1,1};
};
and when I try to compile it, it gives me an error :
F:\C++\Maze\main.cpp|17|error: expected primary-expression before '==' token
F:\C++\Maze\main.cpp|17|error: expected ';' before ')' token|
the line 17 is
if ((Map[myLocation[0]][myLocation[1]-1])) ==' '){
I really hope you guys can help, I'm stuck on this for like over an hour.