This is the first time I have done this, I hope I am doing it correctly. If not, guide me toward proper etiquette. I am a beginner, intro C++.
I received a message from the compiler that I don't know how to fix. My question is where is the error?, where do I look to fix it? it is part of the cpp and header file. (I am rotten at this, good at prototypes, rotten at this) any advise is always appreciated.
tictactoe game
//implementation file for class board
#include <iostream>
using namespace std;
#include "Board.h"
//default constructor
Board::Board()
{
resetAll(); //call private utility function
}
//function to show board during play
void Board::showBoard(char array[][11], int HORIZONTAL, int VERTICAL)
{
cout << "The Tic Tac Toe Board " << endl << endl; //for user
for (int i =0; i < HORIZONTAL; ++i) //locate the proper space
{for (int j = 0; j < VERTICAL; ++j) //saves it in the proper space
cout << array[i][j] << " ";
cout << endl << endl; //just for looks
}
}//end function -showBoard
void Board::resetAll() //private
{
//reset to empty game board
const int HORIZONTAL = 8;
const int VERTICAL = 11;
char board[HORIZONTAL][VERTICAL] = {{' ',' ',' ','|',' ',' ',' ','|',' ',' ',' '},
{' ','.',' ','|',' ','.',' ','|',' ','.',' '}, {'_','_','_','|','_','_','_','|','_','_','_'},
{' ',' ',' ','|',' ',' ',' ','|',' ',' ',' '},
{' ','.',' ','|',' ','.',' ','|',' ','.',' '},
{'_','_','_','|','_','_','_','|','_','_','_'},
{' ','.',' ','|',' ','.',' ','|',' ','.',' '},
{' ',' ',' ','|',' ',' ',' ','|',' ',' ',' '}};
}
//interface file for class Board
#ifndef BOARD_H
#define BOARD_H
#include <iostream>
using namespace std;
class Board
{
public:
//constructors
Board();
//mutator functions
void showBoard(char array[][11], int HORIZONTAL, int VERTICAL);
private:
void resetAll();
};
#endif