In my program i want to return a 3D array,(or an array of arrays of arrays) but I keep getting an error that i dont quite understand.
it says there is a problem with the line "return board;"Code:int*** create_board(int width, int height) { int board[width][height][9]; for(int i=0; i<width; i++) for(int j =0; j<height; j++) for(int k=0; k<9; k++) board[i][j][k] = 1; return board; }
main.cpp:38: error: cannot convert ‘int (*)[(((long unsigned int)(((long int)height) + -0x00000000000000001)) + 1)][9]’ to ‘int***’ in return



LinkBack URL
About LinkBacks


