Also you may want to think about enumerating some types to help you with your 2D array. For example if you had 0 as free, 1 as X and 2 as O it would not be that intuitive to someone else what those values meant. Instead you could do something like

enum STATES { PLAYER_O, PLAYER_X, FREE };

Then you could check those symbolic constants instead of remembering the actual values. Just an idea though.