Yes, but I am asking you specifically about the loop body, i.e.,
Code:
word[i]^=word[len-i-1];
word[len-i-1]^=word[i];
word[i]^=word[len-i-1];
That said, now that I took a good look myself, I think you should examine this example instead:
Code:
int len = strlen(word);
for (int i = 0; i < len / 2; i++)
{
char temp = word[i];
word[i] = word[len - i - 1];
word[len - i - 1] = temp;
}
The same question applies: what does the loop body do? Once you answer this correctly, you are on your way to answering your own question of why "the loop only traverses half of the array".