How to play tic tac toe in C++

// Robert J.
// Gaddis p453 #18
// tic tac toe
//
// CS 1336.0U1

#include <iostream>
using namespace std;  
void sep(){  
    printf ("-----\n");
};

void vsep(){  
    printf("|");
};

void display_table(char data[3][3]) {

    // Display board
    int row, column = 0;
    while ( row < 3 ) {
        column = 0;
        while ( column < 3 ) {
            printf("%c", data[row][column]);
            column++;
            if (column < 3) {
                vsep();
            } else if (column == 3 ) {
                printf("\n");
            } else {
                printf("Column Error");
                EXIT_FAILURE;
            };
        };
        row++;
        if (row < 3){
            sep();
        } else if (row ==3 ) {
            printf("\n");
        } else{
            printf("Row Error");
            EXIT_FAILURE;
        };
    };
};

void win_by_column(char data[3][3], char search_key, int someguy) {  
    int row, column = 0;
    int wincount = 0;
    while ( column < 3 ){
        row = 0;
        while ( row < 3 ) {
            if (data[row][column] == search_key){
                wincount++;
                if (wincount == 3 ) {
                    printf("Player %d wins the game\n", someguy);
                    exit(EXIT_SUCCESS);
                };
            };
            row++;
        };
        wincount = 0;
        column++;
    };
};

void win_by_row(char data[3][3], char search_key, int someguy) {  
    int column, row = 0;
    int wincount = 0;
    while ( row < 3 ){
        column = 0;
        while ( column < 3 ) {
            if (data[row][column] == search_key){
                wincount++;
                if (wincount == 3 ) {
                    printf("Player %d wins the game\n", someguy);
                    exit(EXIT_SUCCESS);
                };
            };
            column++;
        };
        wincount = 0;
        row++;
    };
};

void win_by_diag(char data[3][3], char search_key, int someguy) {  
    int row, column = 0;
    int wincount = 0;

    // forward diag
    while ( column < 3 ){
        if (data[column][column] == search_key){
            wincount++;
            if (wincount == 3 ) {
                printf("Player %d wins the game\n", someguy);
                exit(EXIT_SUCCESS);
            };
        };
        column++;
    };

    //rev diag
    wincount = 0;
    row=0;
    while ( row < 3 ){
        column=2-row;
        if (data[row][column] == search_key){
            wincount++;
            if (wincount == 3 ) {
                printf("Player %d wins the game\n", someguy);
                exit(EXIT_SUCCESS);
            };
        };
        row++;
    };
};



int main(){  
    char array[3][3] = { '*', '*','*', '*','*', '*','*', '*', '*' };
    int row, count = 0;
    int column;

    printf("Player 1 is X and Player 2 is O.\n");
    printf("Input is read as COLUMN then ROW starting at 0.\n");


    while (count < 10 ) {
        int row, column = 0;
        int player, wincount = 0;
        char symbol;

        display_table(array);
        win_by_column(array, symbol, player);
        win_by_row(array, symbol, player);
        win_by_diag(array, symbol, player);

        // cat's game
        count++;
        if (count == 10){
            printf("This one goes to the cats\n");
            break;
        };

        // User input;
        int x, y;
        while (true){
            if (count % 2 == 1) {
                printf("Player one enter coordinates deliminated by spaces: ");
                symbol = 'X';
                player = 1;
            } else {
                printf("Player two enter coordinates deliminated by spaces: ");
                symbol = 'O';
                player = 2;
            };
            cin >> x;
            cin >> y;

            // Check some sanity
            if (x < 3 && x >=0 &&  y < 3 && y >= 0) {
                // Check even more
                if (array[y][x] == '*' ) {
                    break;
                } else {
                    printf("That spot is taken.\n");
                    continue;
                }
            } else {
                 printf("Number is outside of bounds\n");
                 continue;
            };
        };
        array[y][x]=symbol;
        row = 0;
        column = 0;
    };

    // This point should only be reached for a cats game.
    return 255;
};

Output

Mac Shell: Homework6/>$ ./Homework_6b  
Player 1 is X and Player 2 is O.  
Input is read as COLUMN then ROW starting at 0.

 * | * | * 
-----------
 * | * | * 
-----------
 * | * | * 

Player one enter coordinates deliminated by spaces: 0 0 

 X | * | * 
-----------
 * | * | * 
-----------
 * | * | * 

Player two enter coordinates deliminated by spaces: 1 1

 X | * | * 
-----------
 * | O | * 
-----------
 * | * | * 

Player one enter coordinates deliminated by spaces: 2 2

 X | * | * 
-----------
 * | O | * 
-----------
 * | * | X 

Player two enter coordinates deliminated by spaces: 01 0

 X | O | * 
-----------
 * | O | * 
-----------
 * | * | X 

Player one enter coordinates deliminated by spaces: 0 2

 X | O | * 
-----------
 * | O | * 
-----------
 X | * | X 

Player two enter coordinates deliminated by spaces: 1 2

 X | O | * 
-----------
 * | O | * 
-----------
 X | O | X 

Player 2 wins the game  
Mac Shell: Homework6/>$ grep "" -c Homework_6b.cpp  
182  
Mac Shell: Homework6/>$