Palindrome checker in C++