I am trying to build a simple tic tac toe game. And my issue is that my grid when I input a grid space the input is not read and I get an echo of what I just got. Please help
Header File
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#pragma once
#include "Tic-Tac-Toe.h"
#include <iostream>
class Tic_Tac_Toe
{
private:
char square[3][3];
int x;
public:
void draw_board();
void setsquare(int s);
int getsquare();
int player_input(int x);
};
> char square[3][3] = { {'1','2','3'},{'4','5','6'},{'7','8','9'} };
You're NOT copying your local variable 'square' into your class member variable 'square'.