I'm getting the errors shown in the title. I'm sure it's just a simple mistake, but i haven't figured it out.The code is so simple because I just started with C++. I am trying to make a Tic tac toe game, but the error holds me back. Any advice is welcome! :)
main.cpp:
#include <iostream>
#include "Game.h"
using namespace std;
int main()
{
char board[3][3] = { {' ', ' ', ' '}, {' ', ' ', ' '}, {' ', ' ', ' '} };
cout << "*** Tic tac toe ***" << endl;
Game game001(char board[3][3]);
game001.printBoard();
}
Game.h
#pragma once
class Game
{
public:
Game(char a [3][3]);
void printBoard();
private:
char _board[3][3];
};
Game.cpp:
#include<iostream>
#include "Game.h"
using namespace std;
Game::Game(char a [3][3])
{
_board[3][3] = a[3][3];
}
void Game::printBoard()
{
cout << _board[0][0] << endl;
}