how to assign an int value to a game object?

I am currently making a tic tac toe game as one of my first projects in programming, and i am trying to figure out how to make it check when a player has won. In order to do this I came up with a value system in which each cell in the tictactoe board has a specific value and adding either an X or an O increases the value of the cell by one or -1 respectively. So my question is, how can I assign a different int value to each of the cells in the board? For example:

   0   |    1  |   2
_______|_______|________
  -1   |    0  |   1
_______|_______|________
  -2   |   -1  |   0
       |       |

What I would do is use an int array with 9 slots in it to hold values which correspond to each respective tic tac slot.

I thought about that, I just don’t know how to come across to doing it >. <