Bool Palidrome function in Cstring?
<p>I'm writing a function that tells the user whether their input is a palindrome or not (string backwards as it is forwards. I'm supposed to use a bool function that uses the cstring library that was given to me in which I fill in a while statment to execute the algorithm.</p>

<pre><code>bool checkPalindrome(char* cstr)
{
    char* front = cstr;
    char* back = cstr + strlen(cstr)-1;

    while(front &lt; back)
    {
        // i can only change within this while loop
        if(cstr[front] != cstr[back])
        {
            return false;
        }

        front++;
        back++;
    }
    return true;
}
</code></pre>

<p>I honestly don't know if I'm doing this right, I get an "invalid type" error in the if statement within the while loop, because I'm calling a pointer character in an array, which I'm guess I can't do. I wrote a correct function declaring <code>front</code> and <code>back</code> as integers, but I'm supposed to use this exact function only changing what's within the while statement.</p>

<p>Any comments or advise would be appreciated!</p>