I am trying to make a tic tac toe game and I want to pass my 2d array of the tic tac toe board positions to my function that draws the updated board. I want the parameter value of my function "updateBoard" to be able to take in the memory adress of the board from main so I can use it all throughout my program without worrying about scope. I am getting an error as so when i compile it:
error C2664: 'updateBoard' : cannot convert parameter 1 from 'char (*)[3][3]' to 'char *[][3]' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
heres my code:
#include "stdafx.h"
#include <iostream>
using namespace std;
void updateBoard (char *n[3][3])
{
}
int getMove ()
{
int input;
cout <<"\n";
cout <<"1 for square 1| 2 for square 2| and so on... : ";
cin >>input;
return 0;
}
int main ()
{
const int WIDTH = 3;
const int HEIGHT = 3;
char board [WIDTH][HEIGHT] = {' ', ' ', ' ',
' ', ' ', ' ',
' ', ' ', ' '};
updateBoard(&board);
char f;
cin >>f;
}