c++ – Check if a string is palindrome – Stack Overflow

// The below C++ function checks for a palindrome and // returns true if it is a palindrome and returns false otherwise bool checkPalindrome ( string s ) { // This calculates the length of the string int n = s.length(); // the for loop iterates until the first half of the string // and checks first element with the last element, // second …

https://stackoverflow.com/questions/8362572/check-if-a-string-is-palindrome