class Board
{
public:
enum Player {X = -1, O, E};
bool win(Player P); // A function that returns true if Player P has won the game, and
// false otherwise.
}; // end class board
The above is part of my header file for a Tic-Tac-Toe game. I am trying test the win function and confused on how to test it from a driver file:
#include <iostream>
using namespace std;
#include "Board.h"
// function main begins program execution
int main ()
{
Board a;
cout << a.win(X) << endl; // <------------------? ? ?
return 0; // indicate successful termination
} // end function main
I have tried to create a Board::Player type in main but still cannot get it to compile. Any suggestions?