Hello, I'm working on making a minesweeper game using C++ but I'm having trouble re sizing a vector.
Here's what I have:
A vector of ints:
vector<vector<int> > mineField;
A vector of structs:
struct cell{
int value; //(-1 mine, 0 no surrounding, # > 0 number of surrounding mines)
int state; //( 0 hidden, 1 revealed, 2 marked)
bool isMine;
};
vector<vector<cell> > mineField;
The vector of cell is located in a separate .cpp file of a minesweeper class.
What I want to do is re size the vector of cell to have the same dimensions as the vector of ints.
and initialize the struct variable *value* to the values in the vector of ints and the struct
variable *state* to 0.
When attempt to run this I am only able to have the dimensions 5 rows x 5 columns (I cannot figure out why). Any
other dimensions exits the program and netbeans tells me the run has failed.
I have also tried:
this->mineField.clear();
for (int i = 0; i < rowNum; i++){