//I can't see any issues with the way I was using to define String back as //simstring backwards, but I get an on Output Error, saying:
//index out of range: 0 string:
//Note: This program is not completed (obviously). I still have to account for //multiple word palindromes, etc., but I was trying to get it done properly with //single words before I moved on.
I don't know what the type/interface of String looks like, but generally speaking you cannot use operator[] to access elements of a string that don't exist.
Presumably, String back; creates an empty string and it is still empty when back[z]=simstring[C]; happens, which means that z would be an invalid index.
With std::string it would look something like:
1 2 3 4 5
std::string back ;
for ( int C = simstring.length()-1; C>=0; --C )
{
back += simString[C] ; // or back.append(1, simString[C]) ;
}
Presumably your String has equivalent functionality.
You would have to #include <string> for it to work.
It was meant as an example of functionality that is probably included in the non-standard string type you're using, which you need to familiarize yourself with if you want to avoid the error you're encountering.