char vector

let say

char temp[8][8];

and you want to make vector of this char

vector<????> boardVec;
You can have nested vectors as well: std::vector<std::vector<char>>.
However, nested vectors can have bad performance. It's usually better practice (when trying to represent a grid) to have a one-dimensional vector with size equal to the area of the grid, then you can address individual coordinates by the the offset x+y*width
Last edited on
std::vector<std::vector<char>> temp

Or since you are dealing with fixed sized arrays:
const unsigned board_size(8);
std::array<std::array<char,board_size>,board_size> temp;
//Or the more clean looking and probably easier to work with:
std::array<char,board_size*board_size> temp;
Topic archived. No new replies allowed.