[c++] Check if a string is palindrome