C Subscripted value is not an array, pointer, or vector - Yes it is?
<p>I build an app that uses the Vigenere cipher to encoded words or sentences.  It works but everything was contained in main().  I'm rebuilding the app using functions.  But I'm getting the error 'Subscripted value is not an array, pointer, or vector' when it appears to me that it is an array.</p>

<p><strong>Error comes from this</strong></p>

<pre><code>if ((int)sentencetoencode[repeatciphercounter] &lt; 65 || ((int)sentencetoencode[repeatciphercounter] &gt; 90 &amp;&amp; (int)sentencetoencode[repeatciphercounter] &lt; 97) || (int)sentencetoencode[repeatciphercounter] &gt; 122)
    {
        ciphersentence[repeatciphercounter] = (char)32;
</code></pre>

<p><strong>Additional warning for incompatible pointer to integer conversion passing 'char [100]' to parameter type of 'char'</strong></p>

<pre><code>CipherRepeater(sentencetoencode, cipherwordtorepeat, ciphersentence);
</code></pre>

<p><strong>Full Code</strong></p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

char CipherRepeater(char sentencetoencode, char cipherwordtorepeat, char ciphersentence);

int main(int argc, char * argv[])
{
// This is a message to encode using Vigenere cipher
char sentencetoencode[100] = "secret message is come over at five";

// Pass a word at command line, then assign that word to cipherwordtorepeat
// This word is the Vigenere encoding key
// Example word: cat
char cipherwordtorepeat[100];

for(unsigned long argvcounter = 0, argvlength = strlen(argv[1]); argvcounter &lt; argvlength; argvcounter++)
{
    cipherwordtorepeat[argvcounter] = argv[1][argvcounter];
}

// Now the word cat needs to be repeated until it matches the length of the message
// Example "secret message is come over at five"
//         "catcat catcatc at catc atca tc atca"
// Declare an array of characters
// Then the function fills the array with the repeating word
char ciphersentence[100];
CipherRepeater(sentencetoencode, cipherwordtorepeat, ciphersentence);

printf("%s\n", ciphersentence);

return 0;
}

char CipherRepeater(char sentencetoencode, char cipherwordtorepeat, char ciphersentence)
{
// Create a counter to make sure to go back to char 0 in the word array when end is reached
int endofwordcounter = 0;
unsigned long cipherwordlength = strlen(&amp;cipherwordtorepeat);

// Take the cipher word and repeat it until it's the same length as the word to encode
for (unsigned long repeatciphercounter = 0, sentencetoencodelength = strlen(&amp;sentencetoencode); repeatciphercounter &lt; sentencetoencodelength; repeatciphercounter++)
{
    // Put a space in the new string in any spot where a non-letter is used
    if ((int)sentencetoencode[repeatciphercounter] &lt; 65 || ((int)sentencetoencode[repeatciphercounter] &gt; 90 &amp;&amp; (int)sentencetoencode[repeatciphercounter] &lt; 97) || (int)sentencetoencode[repeatciphercounter] &gt; 122)
    {
        ciphersentence[repeatciphercounter] = (char)32;
    }
    else
    {
        // Copy the character
        ciphersentence[repeatciphercounter] = cipherwordtorepeat[endofwordcounter];
        endofwordcounter++;
        if (endofwordcounter &gt;= cipherwordlength)
        {
            endofwordcounter = 0;
        }
    }
}

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