syntax - why am I getting this format error ‘%c’ expects type ‘int’ -
why getting error or conflicting types function? player character want output, show player going next
error
tictac.c:94: warning: format ‘%c’ expects type ‘int’, argument 2 has type ‘char *’ tictac.c:94: warning: format ‘%c’ expects type ‘int’, argument 2 has type ‘char *’
code
void move(char player) { int place; printf("player %c, enter placement: \n", &player); scanf("%d", &place); if (place == 1) board[0][0] = player; else if (place == 2) board[0][1] = player; else if (place == 3) board[0][2] = player; else if (place == 4) board[1][0] = player; else if (place == 5) board[1][1] = player; else if (place == 6) board[1][2] = player; else if (place == 7) board[2][0] = player; else if (place == 8) board[2][1] = player; else if (place == 9) board[2][2] = player; }
you shouldn't use &player
in printf
change
printf("player %c, enter placement: \n", &player);
to
printf("player %c, enter placement: \n", player);
Comments
Post a Comment