I am not sure what exactly your program is supposed to do, so it would be good to have an explanation.
However, the following part of your code looks rather odd to me:
I have some doubts that it does what you intend it should do.
1) You have semicolons after the if and else, which in fact represent an empty statement. The following blocks in curly brackets will always be executed.
2) if (fileName [i] = ch) is an assignment, not a condition