I have a problem in my C code.

So, basically this code is for a Tic Tac Toe game, I'm trying to make a Singleplayer mode where Player 1 inserts a spot number to put his X, and Player 2 uses a random number generating function and assigns his O in a random spot. Everything works fine except, Player 2's random number does not get assigned on the board.

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
char choice, choice2, modsel;
int player = 1, winner, end = 0, counter = 0, ran_num;

char arr[3][3] = {
  {'1','2','3'},{'4','5','6'},{'7','8','9'}
};
void numgen(int rannum) {
    srand(time(NULL));
    rannum = 1 + rand() % 9;
    ran_num = rannum;
}
void printarray() {
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            printf("|%c|", arr[i][j]);
        }
        printf("\n");
    }
}
void playingSP() {
    char letter;
    if (player == 1) {
        scanf("%c", &choice2);
        letter = 'x';
    }
    else if (player == 2) {
        numgen(ran_num);
        choice2 = ran_num;
        letter = 'o';
    }
    else {
        printf("wrong entry");
    }

    switch (choice2) {
    case '1': arr[0][0] = letter; break;
    case '2': arr[0][1] = letter; break;
    case '3': arr[0][2] = letter; break;
    case '4': arr[1][0] = letter; break;
    case '5': arr[1][1] = letter; break;
    case '6': arr[1][2] = letter; break;
    case '7': arr[2][0] = letter; break;
    case '8': arr[2][1] = letter; break;
    case '9': arr[2][2] = letter; break;
    }
    counter++;
}
void endgame() {
    for (int i = 0; i < 3; i++)
        if ((arr[i][0] == arr[i][1]) && (arr[i][1] == arr[i][2])) {
            if (arr[i][0] == 'x')
                winner = 1;
            else
                winner = 2;
            end = 1;
            return;
        }
    for (int j = 0; j < 3; j++)
        if ((arr[0][j] == arr[1][j]) && (arr[1][j] == arr[2][j])) {
            if (arr[0][j] == 'x')
                winner = 1;
            else
                winner = 2;
            end = 1;
            return;
        }
    if ((arr[0][0] == arr[1][1]) && (arr[1][1]) == arr[2][2]) {
        if (arr[0][0] == 'x')
            winner = 1;
        else
            winner = 2;
        end = 1;
        return;
    }
    if ((arr[0][2] == arr[1][1]) && (arr[1][1]) == arr[2][0]) {
        if (arr[0][2] == 'x')
            winner = 1;
        else
            winner = 2;
        end = 1;
        return;
    }
    if (counter == 8) {
        winner = 0;
        end = 1;
    }
}
int main()
{
    printarray();
    while (end != 1)
    {
        printf("player %d enter your number:", player);
        playingSP();
        printarray();
        endgame();
        if (player == 1)
            player = 2;
        else
            player = 1;
        playingSP();
    }
    if (winner == 0)
        printf("no winner\n");
    else
        printf("player %d won the game\n", winner);
    return 0;
}

I have a weird issue in my C code.

So, basically what I'm trying to do is a Tic Tac Toe game for a project. I started with making 3 1-D Char Arrays to represent the game's bord. the code below compares the Arrays data to try and figure out if any of the winning possibilites were achieved by option x or y. There is a variable set to 0, this variable will change to 1 if player1 won and will change to 2 if player2 won, if it remains 0 then it's a draw. Now, there's 16 errors of Error C2446 '==': no conversion from 'const char [2]' to 'int'.

#include <stdio.h>
#include <conio.h>
#include <string.h>
//This function is made to check the result of the round, either one of the players win or it's a draw. It also states who is the winner or if it's a draw.
int main()
{
    int playerwon = 0;//This variable is to indicate which player won, if it's = 1 then Player1 won, if 2 then player2 won, if it remains 0 then draw.
    char board1[4] = {'-','-','-','\0'};
    char board2[4] = { '-','-','-','\0'};
    char board3[4] = { '-','-','-','\0'};

    //Coloumns win check for X, Player 1.
    if (board1[0] == board2[0] && board3[0] == board2[0] && board3[0] == 'x')
    {
        playerwon = 1;
    }
    else if (board1[1] == board2[1] && board3[1] == board2[1] && board3[1] == 'x')
    {
        playerwon = 1;
    }
    else if (board1[2] == board2[2] && board3[2] == board2[2] && board3[2] == 'x')
    {
        playerwon = 1;
    }
    //Rows win check for X, Player 1.
    else if (board1[0] == board1[1] && board1[1] == board1[2] && board1[2] == 'x')
    {
        playerwon = 1;
    }
    else if (board2[0] == board2[1] && board2[1] == board2[2] && board2[2] == 'x')
    {
        playerwon = 1;
    }
    else if (board3[0] == board3[1] && board3[1] == board3[2] && board3[2] == 'x')
    {
        playerwon = 1;
    }
    //Diagonals win check for X, Player 1.
    else if (board1[0] == board2[1] && board2[1] == board3[2] && board3[2] == 'x')
    {
        playerwon=1;
    }
    else if (board1[2] == board2[1] && board2[1] == board3[0] && board3[0] == 'x')
    {
        playerwon = 1;
    }
    //Coloumns win check for Y, Player 2.
    else if (board1[0] == board2[0] && board3[0] == board2[0] && board3[0] == 'y')
    {
        playerwon = 2;
    }
    else if (board1[1] == board2[1] && board3[1] == board2[1] && board3[1] == 'y')
    {
        playerwon = 2;
    }
    else if (board1[2] == board2[2] && board3[2] == board2[2] && board3[2] == 'y')
    {
        playerwon = 2;
    }
    //Rows win check for Y, Player 2.
    else if (board1[0] == board1[1] && board1[1] == board1[2] && board1[2] == 'y')
    {
        playerwon = 2;
    }
    else if (board2[0] == board2[1] && board2[1] == board2[2] && board2[2] == 'y')
    {
        playerwon = 2;
    }
    else if (board3[0] == board3[1] && board3[1] == board3[2] && board3[2] == 'y')
    {
        playerwon = 2;
    }
    //Diagonals win check for Y, Player 2.
    else if (board1[0] == board2[1] && board2[1] == board3[2] && board3[2] == 'y')
    {
        playerwon = 2;
    }
    else if (board1[2] == board2[1] && board2[1] == board3[0] && board3[0] == 'y')
    {
        playerwon = 2;
    }
    //Printing the result of the round!
    if (playerwon = 1) {
        printf("Player one won this round!");
    }
    else if (playerwon = 2) {
        printf("Player two won this round!");
    }
    else if (playerwon = 0) {
        printf("This round is a draw!");
    }
    else {
        printf("Error calculating the round result!");
    }
    return 0;
}