Learn

is_palindrome()

Instructions

1.

Define a function is_palindrome() that takes:

  • An std::string parameter text.

The function should return:

  • true if text is a palindrome.
  • false if text is not a palindrome.

(A palindrome is any text that has the same characters backwards as it does forwards. For example, “hannah” and “racecar” are palindromes, while “menu” and “ardvark” are not.)

We will not test for edge cases such as capitalization or spaces.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?