hello,
i came across this code in C++ the complete reference by herb schildt,
specifically in the tic-tac toe example:
void get_player_move(void)
{
int x, y;
printf("Enter X,Y coordinates for your move: ");
scanf("%d%*c%d", &x, &y);
x--; y--;
if(matrix[x][y]!= ' '){
printf("Invalid move, try again.\n");
get_player_move();
}
else matrix[x][y] = 'X';
}
My problem is in the scanf statement. what is the purpose of *c?
when i remove *c and execute the prog. vista shows the message tic-tac-toe.exe has stopped working.
what am i doing wrong ?
i am using vista and visual C++2008 Express.
kindly spare your time to answer this, and sorry if this has been asked before but i couldn't find the solution.