I am getting the above error code in my program stating -- "function-style initializer appears to be a function definition." The problem is that where the error is pointing to is a function definition. Does anyone have any idea whi I am getting, and how I can correct this error?
const int rows = 3; //Define number of rows in array
const int col = 3; //Define number of columns in array
int row, column;
char table [rows][col];
bool isWinner = false;
char letter;
void showarray(char [][col], int);
int spacetaken (int, int);
bool TestWinner();
int _tmain(int argc, _TCHAR* argv[])
{
int row, column;
if (table(0,0) == letter && table(1,1) == letter && table(2,2) == letter) //diagonal top left to bottom right
{
isWinner = true;
}
if (table(0,2)== letter && table(1,1) == letter && table(0,2) == letter) //diagonal top right to bottom left
{
isWinner = true;
}
if (table(0,0) == letter && table(1,0) == letter && table(2,0) == letter) //straight down, left column
{
isWinner = true;
}
if (table(0,1) == letter && table(1,1) == letter && table(2,1) == letter) //straight down, middle column
{
isWinner = true;
}
if (table(0,2) == letter && table(1,2) == letter && table(2,2) == letter) //straight down, right column
{
isWinner = true;
}
if (table(0,0) == letter && table(0,1) == letter && table(0,2) == letter) //horizontal top row
{
isWinner = true;
}
if (table(1,0) == letter && table(1,1) == letter && table(1,2) == letter) //horizontal middle row
{
isWinner = true;
}
if (table(2,0) == letter && table(2,1) == letter && table(2,2) == letter) //horizontal bottom row
{
isWinner = true;
}
return isWinner;
}