const int width = 100, height = 100;
void clearBoard(bool *board[]);
int main(int argc, char *argv[])
{
bool gameboard[width][height];
clearBoard(gameboard);
QApplication a(argc, argv);
MainWindow window;
window.show();
return a.exec();
}
void clearBoard(bool *board[]){
for(int x = 0; x < width; x++)
for(int y = 0; y < height; y++)
board[x][y] = false;
}
The error at hand is:
C2664: 'void clearBoard(bool *[])' : cannot convert argument 1 from 'bool [100][100]' to 'bool *[]'
I think I have the basic understanding of how pointers work, and 2D pointer, but for some reason this won't work. Would love it if someone could explain what I'm getting wrong.