void generalboard();
void inputuser(int*pt1, int*pt2,int*pt3);
void checkwins1d(int*A,int*B, char C[][3][3]);
void checkwinsup(int*A,int*B,char C[][3][3]);
void checkwins3D(int*A,int*B,char C[][3][3]);
void inputcomputer(int*pt1,int*pt2,int*pt3,char A[][3][3]);
void score (int a, int b);
void displayboard(int a, int b, int c, int i, int j, int k, char board [][3][3]);
int main () {
int i,j,k,a,b,c,computerscore=0,userscore=0,counter=0;
char board[3][3][3];
generalboard();
inputuser(&i,&j,&k);
inputcomputer(&a,&b,&c,board[3][3][3]);
displayboard(a,b,c,i,j,k,board[3][3][3]);
while (counter<=27){
inputuser(&i,&j,&k);
counter++;
inputcomputer(&a,&b,&c, board[3][3][3]);
counter++;
displayboard(a,b,c,i,j,k,board[3][3][3]);
checkwins1d(&userscore,&computerscore,board[3][3][3]);
checkwinsup(&userscore,&computerscore, board[3][3][3]);
checkwins3D(&userscore,&computerscore,board[3][3][3]);
score(computerscore, userscore);
}
if (computerscore> userscore) printf("Computer is the winner.\n");
else if (computerscore<userscore) printf ("Congrats, you won!\n");
else printf("it is a draw.\n");
return 0;
}
This is a 3D TTT game program... for all the function that contains a 3d array, it always show that there is an incompatible pointer...
I tried the following possibilities:
void inputcomputer(int*pt1,int*pt2,int*pt3,char *A);
int main{
//assumed I declared all the int and char)
inputcomputer(a,b,c,char A[][3][3]);// but it doesn't seem to work and still show the same error...
happyhappyhappy 0 Newbie Poster
Arbus 25 Practically a Master Poster
happyhappyhappy 0 Newbie Poster
Arbus 25 Practically a Master Poster
Salem 5,248 Posting Sage
happyhappyhappy 0 Newbie Poster
Arbus 25 Practically a Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.