Learn
Code Challenge: C++ Functions
Palindrome
is_palindrome()
Instructions
1.
Define a function is_palindrome()
that takes:
- An
std::string
parametertext
.
The function should return:
true
iftext
is a palindrome.false
iftext
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.