Yes, there is. When you are reading a file char by char, you do not read in EOF with the last char, like you would if you were reading word by word with the >> operator. So, when reading char by char, it takes one more loop to read in EOF and that extra time through the loop causes the last char to get duplicated.

One way to solve that problem when reading char by char is this:
Code:
fIn.get(ch);
while(!fIn.eof()) {
fIn.get(ch);
++x;
}