c++ array code error
<p>The code won't run, says the "return value" is wrong where it says return <code>found[i]=letter</code>, and the <code>srand time</code> is also showing error. I am not sure how to fix it? Perhaps put <code>found[i]</code> in <code>main()</code> and put <code>return 1?</code>? And not sure how to get the <code>srand</code> to work properly? </p>

<pre><code>#include &lt;iostream&gt; 

using namespace std; 
void getarray(char [], int); 
void printa(char [],int ); 
void search(char [],int, char); 
void main() { 
    srand(time(0)); //1-declare char letter=' '; 
    char guess[7]; 
    char found[7]={letter}; 
    int res=0; 
    char answer='Y';
}
//2-init
getarray(guess,7); 
//3- processing 
printa(guess,7);
while(answer == 'Y')
{
    cout &lt;&lt; "enter a letter";
    cin &gt;&gt;letter;
    search(guess,7,letter); 
    if (res != -1)
        printa(found,7);

    cout &lt;&lt;" do you want to continue(Y/N)?"&lt;&lt;endl;
    cin &gt;&gt;answer;
}

//printing
system("pause");
}
void getarray(char a[], int n)
{
    for(int i=0;i&lt;n;i++)
        a[i]= 65 + rand()%26;
}
void printa(char a[], int n)
{
    for(int i=0;i&lt;n;i++)
        cout &lt;&lt; " the letter " &lt;&lt; i+1 &lt;&lt; " is "&lt;&lt;a[i]&lt;&lt;endl;
}
void search(char a[],int n, char key)
{
    for(int i=0;i&lt;n;i++)
        if ( a[i]== key)
            return Found[i]=={letter}; 
}
</code></pre>
