You're missing the point. You won't need to end the game if you can even play it.
Here is a little more help, it's your code just modified a bit.
Code:
#include <stdio.h>
#include <stdlib.h>
void info()
{
printf("TIC-TAC-TOE\nWritten by MEEEE\n");
printf("Your Symbol 'x'");
printf("Computer Symbol 'o'");
}
/*initialize board*/
void init(char cell[])
{
int i;
for (i=0; i<9; i++)
cell[i] = ' ';
}
/*print gameboard */
void gameBoard(char cell[])
{
printf("\n %c | %c | %c \n", cell[0], cell[1], cell[2]);
printf("---|---|---\n");
printf(" %c | %c | %c \n", cell[3], cell[4], cell[5]);
printf("---|---|---\n");
printf(" %c | %c | %c \n\n", cell[6], cell[7], cell[8]);
}
/*player moves*/
void userMove(char cell[])
{
int i = 0;
int cont = 1;
do{
printf("Your Move (0-8): ");
scanf("%d", &i);
if((cell[i] != ' ') || (i < 0 || i > 8))
{
printf("Invalid Input\n"); //invalid input
}
else
{
cell[i] = 'x';
cont--; //set while loop to false, break
}
}
while(cont);
}
/*computer moves*/
void computerMove(char cell[])
{
int i = 0;
int cont = 1;
do
{
if(cell[i] == ' ')
{
cell[i] = 'o';
cont--;
}
else
{
i++;
}
}while(cont);
}
int main()
{
char cell[9];
int cont = 1;
int ccode = 0;
info();
init(cell);
gameBoard(cell);
while(cont)
{userMove(cell);
gameBoard(cell);
//check if user wins
//if user wins, print user won
//and cont-- to exit loop
computerMove(cell);
gameBoard(cell);
//check if computer wins, print computer won
//and cont-- to exit loop
//if nobody won get another user input
}
return 0;
}
Now you have to make your code work for the checkWinner and printWinner.