I've seen a number of posts on this but they all seem to be addressing when spme sort of method is defined.
Background for app: Just trying to make a basic Sudoku game to get the hang of C++.
The error seems independent of the main function .cpp file, so I'll ignore it unless it's requested to keep the explanation short.
The board.h file:
#pragma once
class board
{
public:
board(int gameSize, int diffifuclty) : gameSize(gameSize), difficulty(difficulty) {};
~board();
private:
int gameSize; int difficulty;
int game[gameSize][gameSize][gameSize][gameSize];
void createRandom(); // Creates a random workable board.
void hasSolution(); // Checks if there's a solution from the current state.
};
I haven't toyed much with the board.cpp file yet, as I was just busy defining everything in the board.h file to plan out what functions I want to write.
Anyways, I want to have a game board with gameSize
and difficulty
being inputted in the console. I'm getting the error mentioned in my title when I try to construct the multidimensional array for the game board. (So with Sudoku, the 9x9 game has game size 3 here.)
I'm not sure what the error is or how to make this array an attribute (I'm not sure if this is C++ terminology, so sorry) of board?