A draw in tic-tac-toe happens when the board is filled but none of the players have three in a row, right?
So you just need to extend the function, here is some pseudocode to get your rolling:
Code:
int checkWinner()
{
//Checker om X har vundet
if(board[0][0] == 'X' && board[0][1] == 'X' && board[0][2] == 'X')
return 1;
if(board[1][0] == 'X' && board[1][1] == 'X' && board[1][2] == 'X')
return 1;
if(board[2][0] == 'X' && board[2][1] == 'X' && board[2][2] == 'X')
return 1;
if(board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X')
return 1;
if(board[0][1] == 'X' && board[1][1] == 'X' && board[2][1] == 'X')
return 1;
if(board[0][2] == 'X' && board[1][2] == 'X' && board[2][2] == 'X')
return 1;
if(board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X')
return 1;
if(board[2][0] == 'X' && board[1][1] == 'X' && board[0][2] == 'X')
return 1;
//Checker om O har vundet
if(board[0][0] == 'O' && board[0][1] == 'O' && board[0][2] == 'O')
return 2;
if(board[1][0] == 'O' && board[1][1] == 'O' && board[1][2] == 'O')
return 2;
if(board[2][0] == 'O' && board[2][1] == 'O' && board[2][2] == 'O')
return 2;
if(board[0][0] == 'O' && board[1][0] == 'O' && board[2][0] == 'O')
return 2;
if(board[0][1] == 'O' && board[1][1] == 'O' && board[2][1] == 'O')
return 2;
if(board[0][2] == 'O' && board[1][2] == 'O' && board[2][2] == 'O')
return 2;
if(board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O')
return 2;
if(board[2][0] == 'O' && board[1][1] == 'O' && board[0][2] == 'O')
return 2;
//When you reach this point, you know nobody has three in a row. So now you just need to check if the board is full. If it is, it's a draw. If the board is not full, that means the game is not over yet.
for i to 3
for j to 3
if(board[i][j] == ' ') return 0; //There is an empty space here. The game is not over, return 0.
return 3; //No empty spaces found, the game is a draw.
Does that make sense? Now you just need to implement this in C++, which shouldn't be too difficult.
Regarding your coding style:
Instead of just returning 0, 1, 2 or 3 from this function, why don't you return an enum with the different gamestates?
Code:
enum GameState {X, Y, NONE, DRAW};
This is a much clearer way of conveying the meaning of the return value of the function.
Also, it seems this function is not a member-function, and you are not passing the board[][] to it as a parameter, which basically means you have the board declared as a global? Is this correct? Globals are considered very poor coding practice. Declare your board inside main() and pass it to this function as a parameter. Or even better, make Board a class and have the array as a member variable, then you can have this function as a member-function.