struct boardType
{
int boardNumber[8][7][7];
int numberOfBoards;
};
//note: int main() is assumed as standard "bloodshed DEV-C++" compiler
boardType totalBoards;
totalBoards.numberOfBoards = 8;
totalBoards.boardNumber[0] = {{0,0,0,0,0,0,0},
{6,6,6,1,6,6,1},
{6,6,6,6,6,6,1},
{6,6,6,6,6,6,1},
{6,6,6,6,6,6,1},
{6,6,6,6,6,6,1},
{5,5,5,5,5,5,5}};
expected primary-expression before '{' token
expected ';' before '{' token
Above shows the script I am trying to make work. the quote is the error that is built when first row compiles. Im trying to see where but my ignorance and in ability to memorize array syntax is truely showing
EDIT: what I am trying to do is store 8 boards that are 7x7 each. I don't wish to use vectors because I am trying to understand arrays. Vectors come later :P
3 dimentional arrays or a one dimentional struct that stores a 7x7 array. Im using structs to store the full list of arrays.
struct boardType
{
int boardNumber[7][7];
};
boardType currentBoard[8];
currentBoard[0].boardNumber = {{0,0,0,0,0,0,0},
{6,6,6,1,6,6,1},
{6,6,6,6,6,6,1},
{6,6,6,6,6,6,1},
{6,6,6,6,6,6,1},
{6,6,6,6,6,6,1},
{5,5,5,5,5,5,5}};