title: Arrays in a Palindrome program
body: <p>So I made a program where I have to input a word and it displays if it is a palindrome (a word that is the same both ways) or not.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  int main(int argc, const char * argv[]){
      char word;
      int length, counter;
  
      printf("Please enter a word: ");
      scanf("%c", &amp;word);
  
      int flag = 1;
  
      for (counter = 0; counter &lt; length &amp;&amp; flag; counter++) {
          printf("%c\t %c", word[counter], word[length - counter])
          if (word[counter] == word[length - counter - 1]){
              flag = 0;
          }
      }
      if (flag) {
          printf("%c is a palindrome!", word);
      }
      else {
          printf("%c is NOT a palindrome!", word);
      }
  }
  </code></pre>
  
  <p>I set it up so that it displays each letter side by side. If a letter isn't the same then the flag is "thrown"(set to 0) and this will end the program saying: "word is NOT a palindrome!" </p>
  
  <p>I get an error at the part where it says word[counter] saying it isn't a subscripted value. What can I do to make this work? Is there anything else I am doing wrong?</p>