int checkWinDiagonals(char board[N][M])
{
for(int i = 0; i < (N-3); i++)
{
for(int j = 0; j < (M-3); j++)
{
if(board[i][j] != ' ' && board[i][j] == board[i+1][j+1])
{
if (board[i][j] == board[i+2][j+2] && board[i][j] == board[i+3][j+3])
{
return 1;
}
}
}
}
for(int i = 0; i < (N-3); i++)
{
for(int j = 3; j < M; j++)
{
if(board[i][j] != ' ' && board[i][j] == board[i+1][j-1])
{
if( board[i][j] == board[i+2][j-2] && board[i][j] == board[i+3][j-3])
{
return 1;
}
}
}
return 0;
}
}
I get this error "control reaches end of non-void function".Forget int main() because this is just a piece of the code in which it doesnt work.Do I have to put return (something); in some place?