Hello! I'm trying to learn DirectX from a book called Beginning DirectX 9. I've come to a part where I'm learning to load images and put them to the screen, all is going well although there are many errors in the book I had to correct myself.

The book shows how to load an image of the letters A through Z and by looping through a character string it is able to find the letter on the image and cut them out and paste them after each other.

I've come across this:

int srcY = ( ( ( *c - 'A' ) / 6 ) ) * letterHeight;
int srcX = ( ( ( *c - 'A' ) %7 ) * letterWidth );

Where *c is the current character in the string and letterHeight & width are the height and width of the letters.

this is somehow finding the correct X and Y coordinate of the letter on the image, I'm just curious as to how this works. Could someone explain to me what that is doing? e.g. *c - 'A', I have no idea what that does and the only thing the book says about it is:

"Each time through the loop, you are working with only one letter. For example, the first
time through the code, you’re handling only the H from the word “HELLO”. The code then
computes the source rectangle by getting the top-left X and Y coordinates for this letter."

and also %7

More info:
The bitmap of the letters is 336x192, width and height of the letters are 48, there are 6 letters across the top of the image and 4 going down with two empty squares at the end.

Thanks Malb