warning: passing argument 1 of 'play' from incompatible pointer type
Hey, I'm trying to program a tic tac toe game to the specifications of my professor, and im having an issue with pointers and 2D arrays. Anyone know what is wrong with this program (dont worry about the fact that i didnt use #include to load some stuff, this is only a portion of the program)
If you can help me please post a response in a simple explination that doesnt go into technical terms. I know basics about this language but i dont know everything.
The warning happens in the main function, when i use the function 'play'. Something isnt working with my 2D array being used with pointers.
void play (char *board, int *player)
int x,y = 0;
printf("Player %d: choose a location: (x, then y)", *player);
scanf("%d %d", &x, &y);
if (*board[x][y] != ' ')
printf("Location already occupied\n");
while (*board[x][y]!=' ');
if (*player = 1)
else if (*player = 2)
for (i = 0; i < 3; i++)
for (l = 0; l <3;l++)
int player = 1;
my friend reminded me that arrays dont need pointers. dun and dun. buhbai.
|All times are GMT. The time now is 09:11 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.