Problem with loops and strings

Here's a link to my code

The purpose of my code is to read from a file that contains the name and number
of other files that I then need to read and decrypt the text within those files. The code for decrypting the text is the first line of each text file. I then need to write the decrypted code to another file. That's the basic idea of it.

My code compiles file but i receive an error when I run it that states that i'm doing something out of range?
"terminate called after throwing an instance of 'std::out_of_range'"

Any help would be wonderful and I do apologize for any inconveniences. I am a beginner.
By far the best thing to do is learn how touse the debugger. IF you are using an IDE then there should be a debugger built in, with a graphical interface.

You can set breakpoints, have a watch list of variable values, step through the code 1 line at a time.

This is much better than staring at code for hours.

Hope all goes well.
Thanks for the suggestions. I did go back and start outputting things to the screen and I believe that the error occurs somewhere in case 'r', which reverses the string inside the text file
Did you find the problem? I think it is to do with variable n.

Hopefully you can work this out with the debugger.
Yes I did. The problem ended up being that I forgot the offset in the '#' and 'i' cases(I needed to add or subtract 48) and that i should have used the comparison operator instead of the assignment operator in my if statement.
Thanks for all the suggestions!
Topic archived. No new replies allowed.