You shared a code that does not (even compile neither) have any existing check for winning or losing, so the "easier way" doesn't really apply as there's nothing to compare to. :)
To check if someone is a winner, you should check horizontal, vertical and diagonal lines for the same symbol ('x' or 'o').
I'd have a two-dimensional 3x3 array to store the board with 3 possible values: 'x', 'o' and nothing entered yet, e.g. ' ' (space).
Then you check if every symbol is the same (horizontally, vertically or diagonally).
Does this make sense?