This a basic program for my class that is to compute a palindrome by getline-ing a string, reversing it, and compressing it. I keep getting a runtime error with the Expression: string subscript out of range.
Also, functions were not allowed. I use Visual C++, and I can run the program until somewhere after line 35. It displays the compressed version then displays error message. I'm not even sure if the compiler is telling where the problem is. Thank you for the help to whoever finds me.
In addition, when VS asserts, you can press "Retry" and it'll break in some windows file. However, you can then look down your call stack you'll see something like:
<ProjectName>.exe!main() Line xxx
If you double-click this line it'll take you to the line that Yanson pointed out.
Thank you, that worked and it runs, but now I'm having trouble with what's being displayed. The compressed string just keeps adding on top of the previous loop. How do I clear the string every time?