c++ - Trying to make a function call to fill character array but keep getting error? -
i writing tic tac toe game using 2-dimensionaly char-array keep game state, compiler giving me error:
cannot convert parameter 1 'char' 'char [][3]' 1> conversion integral type pointer type requires reinterpret_cast, c-style cast or function-style cast.
the code:
int main() { srand(int(time(0))); char board[max_rows][max_cols]; zerofill(board[max_rows][max_cols]); int num=1,num2=1; (int i=0;i<9;i++) { if (i%2==0) { myturn(board[max_rows][max_cols],num,num2); myturn(board[max_rows][max_cols],num,num2); num++,num2++; } else theirturn (board[max_rows][max_cols],num, num2); num++,num2++; } return 0; }
what doing wrong?
there numerous problems in program, suspect particular compiler error having arising call 'zerofill'. haven't provided declaration of 'zerofill' function, apparently written accept char[][3], board type. passing single character. 'board' pointer pointer char. board[x] pointer char. board[x][y] char.
Comments
Post a Comment