Original Post
I've got a maze generator program I've been working on as a learning tool. I wanted to create a scoring mechanism for user solving, and to do that I need to know in advance what the solution is. I have code that automatically solves the maze. And I am using bitwise logic to store the state of each maze cell in my vector array.
As the user solves the maze, they are storing in the primary array their progress. I wanted to keep that, but make a duplicate vector array that has the computer's solve path's stored in it. So I figured I could pass to the function that solves the maze (and handles pathing) which array to work on via pointer. like this:
The error I'm getting is: binary '&' : 'std::vector<_Ty>' does not define this operator or a conversion to a type acceptable to the predefined operator
So is there a different/better/correct way to pass a multidimensional vector to a function as a pointer that won't cause this problem?
Thanks!!!
As the user solves the maze, they are storing in the primary array their progress. I wanted to keep that, but make a duplicate vector array that has the computer's solve path's stored in it. So I figured I could pass to the function that solves the maze (and handles pathing) which array to work on via pointer. like this:
// This is the call for the users pathing in the maze
solveMaze(&glMaze)
// This is the call for the computers pathing in the maze
solveMaze(&glMazeSolution)
// ...
// Here's the function and just the line that I'm getting the error
bool solveMaze(vector<vector<int> > * maze)
{
if (((maze[CurrRow -1][CurrCol] & ALL_PATHS) == 0) && ((maze[CurrRow -1][CurrCol] & ALL_BACKS) == 0)) {
// Do Stuff
}
}
The error I'm getting is: binary '&' : 'std::vector<_Ty>' does not define this operator or a conversion to a type acceptable to the predefined operator
So is there a different/better/correct way to pass a multidimensional vector to a function as a pointer that won't cause this problem?
Thanks!!!