Originally Posted by
laserlight
You shouldn't open three files at once when you only need two at that time: the first for reading and the second for writing. After closing those two files, when you need to open the second file again for reading, you can then do that.
Also, ch is still a char when it should be an int, as mentioned by Click_here in post #3.
And honestly, just call it "encryption" if you will. As I noted in post #8, in a cryptographic context, the use of "code" and "encoding" here is inappropriate as it refers to a different though related concept: it is a simple substitution cipher, as exceedingly simple as it may be.