This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
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