| Author |
Program Help
|
Adam Stever
Greenhorn
Joined: Jul 23, 2012
Posts: 9
|
|
I am posting a program that needs some obvious attention, My goal here is to prompt the user wether they would like to encrypt or decrypt their file and obviously just incement by 1, Please help.
|
 |
John Jai
Bartender
Joined: May 31, 2011
Posts: 1778
|
|
Please TellTheDetails. What are the errors you are facing?
One obvious error is you have declared fileName as a String variable, but you try to use it as an array.
|
 |
Michael Krimgen
Ranch Hand
Joined: Jul 08, 2012
Posts: 34
|
|
Hi,
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
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
|
|
|
Well done picking up the extra semicolons. I think that block won’t even complete since the else is separated from its if by the semicolons.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
|
|
|
This thread looks to me like a duplicate of the last question here, so I shall close it.
|
 |
 |
|
|
subject: Program Help
|
|
|