This is from a tic tac toe game I'm making, it's the function to check if there is a win or not. It's simple code so you should be able to see what I'm doing with no problems. I have it set up to check in my array if there is a win, if so it returns a 1 if no it returns a 0 .. but it never returns a 1. Here's the code.
As you can see I only have one win situation set up, just for testing. The way this works is I have a do while loop that takes the user info, puts it in the array. It's set up as a do while win = '0' loop. Then I do win = checkwin(); before the end of the loop and it doesn't do anything. Any suggestions?Code:int checkwin(void) { if ((board[1][1] == 'X') && (board[2][0] == 'X') && (board[0][2] == 'X')) return ('1'); else return('0'); }