Hi,
I'm writing some code that involves moving letters around a grid that is printed out into the command line of a terminal window on Linux. The grid is set up as a number of variables (i.e. A1, A2, A3, B1, B2....etc) and the letter needs to be moved to the coordinate on the grid that the user has selected. I'm reading the user's input (which is simply the coordinate that they want the letter moved to, 'A1') into a separate variable(char Y) using scanf, and the problem I've got is that i'm not sure how to change the coordinate variable once it's been read into the variable Y....what i'm trying to say is, i don't know how to get the inputted coordinate out of the variable Y to change it.
I realise i'm not explaining this very well at all, i'll post a little snippet of code incase that helps:
Code:
printf("Enter the co-ord to move the letter to: ");
scanf("%c", &Y);
printf("\n");
/* function to change coordinate variable */
Sorry for the poor explanation...hopefully some of you can work out what i'm trying to say!!!