I had to look that up ,,
Palindrome, Palindrome Words List, Longest Examples, Define Palindrome
Palindrome List – Palindromes, Palindrome Words, Examples
so what is the basis of comparison to find one? Because by taking a 'd' it says it is, then by using an example in that list I get nope.
Code:
userx@slackwhere:~/bin
$ ./temp
d
d
is a palindrome.userx@slackwhere:~/bin
$ ./temp
A car, a man, a maraca.
helloacaramanamaraca
is not a palindrome.userx@slackwhere:~/bin
$
Plus you have no lead in message telling the user what to do. If I did not read the code and what you said to do in your explanation in here then I'd be lost.
id try flipping your if else around then run a few more different ones to see what that does.
Code:
if(s==string(s.rbegin(),s.rend()))
cout<<s<<"\nis not a palindrome.\n";
else
cout<<s<<"\nis a palindrome.\n";
Code:
userx@slackwhere:~/bin
$ ./temp
A car, a man, a maraca.
acaramanamaraca
is a palindrome.
userx@slackwhere:~/bin
it might be that return value that is causing this effect, I do not know what it is.