removing/deleting characters from char array[] using pointers
<p>I need help removing spaces and special characters from an char array.The problem I keep running into is that the erase function only works on string datatypes, if I'm not mistaken. The assignment calls for a char array not a string so I cant just convert it or have a string variable. I've tried looking it up but everything kind of just suggests to convert it to a string or start off as a string, which I can't do. I'm new to programming and pointers are a little weird to me so if the answer is obvious I am sorry. Thanks in advanced to all of you that help.   </p>

<pre><code>#include "stdafx.h"
#include &lt;iostream&gt;
#include &lt;stdio.h&gt;
#include &lt;string&gt;
#include &lt;stdlib.h&gt;
#include &lt;ctype.h&gt;
using namespace std;

       int main()
        {
            const int SIZE = 80;
            char str[SIZE];
            char* strPtr;
            int strlength;
            int j = 0;
            int front = 0, back; int flag = 1;

            strPtr = str;

            cout &lt;&lt; "This program checks for palidromes." &lt;&lt; endl;
            cout &lt;&lt; "Please enter a phrase." &lt;&lt; endl;
            cout &lt;&lt; endl;
            cin.getline(str, SIZE);

            //Get the length of string str

            strlength = strlen(str);

            //Convert all the characters in the string str to uppercase
            for (int i = 0; i &lt; strlength; i++)
            {
                if (!isupper(str[i]))
                    str[i] = toupper(str[i]);
            }   

            //Remove all the special characters except letters a - z
            for (int i = 0; i &lt; strlength; i++)

                if (!isalpha(str[i])||(!isalnum(str[i])))
                {
                    str.erase(str[i]); // need help here. Not sure how to go about it.
                }

            //str[j] = '\0';

            return 0;
        }
</code></pre>