title: Determine if input is a palindrome in C
body: <p>I'm fairly new to C and I'm having a little bit of a problem. I have to write a program that takes user input and determines if the input is a palindrome. I've got the program to reverse the input, but I'm having trouble getting the strings to compare. All input comes out as not being a palindrome. I'm suppose to use integer subscript index to be able to compare the input. Also I'm suppose to ignore all non letter characters, which I think is a c.type function.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #define N 50
  
  main()
  {
      char array[N] = {0};
      char front;
      char end;
      char x;
      char w =0;
      char i;
      char forward;
      char reverse;
  
      printf("Enter Message: ");
      gets(array);
  
      front = sizeof(array);
      end = sizeof(array) - 1; 
  
      for( i = 0; i &lt;= front; i++){      
         forward = array[i];
  
      } 
      for( x = end; x &gt;= 0; x--){
         reverse = array[x];
      }
  
      if (forward != reverse){
         w = 1;
      }
  
      if(w == 1){
        printf("Not a Palindrome");
      } 
      else{
          printf("Palindrome");
      }
  
      printf("\n");
      return 0;
  }
  </code></pre>