palindrome

what is palindrome fmction in c plus plus?
1
2
3
4
5
6
7
bool is_palindrome(std::string str)
{
    for (int start = 0, end = str.size()-1; start < end; ++start, --end)
        if (str.at(start) != str.at(end)) 
            return false;
    return true;
}
Last edited on
Topic archived. No new replies allowed.