It's difficult to figure out what the code does, unless the writer or poster, gives it the right kind of indentation.
Consider this:
(No indentation)
Code:
void sortCharacter(char cLetter)
{
if (cLetter <= '9' && cLetter >= '0')
letterCount[cLetter - 48]++;
else if ((cLetter <= 'z' && cLetter >= 'a') || (cLetter <= 'Z' && cLetter >= 'A'))
{
if (cLetter <= 'Z' && cLetter >= 'A')
letterCount[cLetter - 55]++;
else
letterCount[cLetter - 87]++;
}
}
and compare it to this:
Code:
void sortCharacter(char cLetter)
{
if (cLetter <= '9' && cLetter >= '0')
letterCount[cLetter - 48]++;
else if ((cLetter <= 'z' && cLetter >= 'a') || (cLetter <= 'Z' && cLetter >= 'A'))
{
if (cLetter <= 'Z' && cLetter >= 'A')
letterCount[cLetter - 55]++;
else
letterCount[cLetter - 87]++;
}
}
If you're used to programming, your eye see's how the flow of the program will proceed, and the logic that it is defining MUCH easier, in the second example.
Even without indentation, this is easy code to understand. What is it about it that leaves you with questions? Is there some specific block or lines of code that confuse you?
If you could cut that out from your original post, give it some indentation, and post it back up with your specific questions, I'm very certain you'll have a quick answer.
Hope that helps.
Adak