Question
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
// Palindromeflip functionstring palindromeflip(string str)
{
// The final and reverse strings are setup
string fs,rs;
// The reverse string is set to call the reverse function
rs=reverse(str);
// Attaches the input and reverse string
fs=str+rs;
// Returns the final string
return fs;
}
// Reverse function
string reverse(const string& str)
{
// Copying the passed inputer string and the reversed string
string cstr, rstr;
// Copy the input string variable
cstr=str;
// Reversing the string
for(int i=0;i<int(cstr.length());i++)
{
rstr = str[ i ] + rstr;
}
// Returning the reversed string
return rstr;
}...