how to search an array for letters
<p>was looking over this program and im trying to figure out how to search for letters in an array instead of numbers, it works for numbers but how can i make it work for letters. please help............... here is the code</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;
const int DECLARED_SIZE = 4;

void fillArray(int a[], int size, string&amp; letter);
int search(const int a[], string letter, string target);

int main( )
{
    int arr[DECLARED_SIZE]; string listletter; string target;
    fillArray(arr, DECLARED_SIZE, listletter);
    char ans;
    int result;
    do
    {
        cout &lt;&lt; "Enter a letter to search for: ";
        cin &gt;&gt; target;
        result = search(arr, listletter, target);
        if (result == -1)
            cout &lt;&lt; target &lt;&lt; " is not on the list.\n";
        else
            cout &lt;&lt; target &lt;&lt; " is stored in array position "
            &lt;&lt; result &lt;&lt; endl
            &lt;&lt; "(Remember: The first position is 0.)\n";
        cout &lt;&lt; "Search again?(y/n followed by Return): ";
        cin &gt;&gt; ans;
    } while ((ans != 'n') &amp;&amp; (ans != 'N'));
    cout &lt;&lt; "End of program.\n";
    return 0;
}

void fillArray(int a[], int size, string&amp; letter)
{
    cout &lt;&lt; "Enter up to " &lt;&lt; size &lt;&lt; " letter.\n"
        &lt;&lt; "Mark the end of the list with a negative number.\n";
    int next, index = 0;
    cin &gt;&gt; next;
    while ((next &gt;= 0) &amp;&amp; (index &lt; size))
    {
        a[index] = next;
        index++;
        cin &gt;&gt; next;
    }
}

int search(const int a[], string numberUsed, string target)
{
    int index  = 0; 
    string run = "run";
    bool found = false;

    while ((!found)) // &amp;&amp; (index &lt; numberUsed))
        if (target == run)
            found = true;
        else
            index++;

    if (found)
        return index;
    else
        return -1;
}
</code></pre>
