title: strcmp return value is wrong (beginner)
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  void getSentence(char userSentence[]);
  int breakSentence_andCompare(char userSentence[] , char compareSentence[]);
  
  #define MAX_SENTENCE 100
  
  int main()
  {
      int len = 0;
      char userSentence[MAX_SENTENCE] = {'o','k',0};
      char compareSentence[MAX_SENTENCE] = {'o',0};
      getSentence(userSentence);
      len = breakSentence_andCompare(userSentence,compareSentence);
  }
  
  /*
  This function is asking the user to input info.
      input:user input string array - char userSentence[].
          output:none.
  */
  void getSentence(char userSentence[])
  {
      printf("Hello And Welcome To The Palindrome Cheker Made By xXTH3 SKIRT CH4S3RXx");
      printf("\nPlease Enter A Sentence: ");
      fgets(userSentence,MAX_SENTENCE,stdin);
  }
  
  /*
  This function takes the input of the user and input it into another string backwards.
      input:user input string array - char userSentence[], backward user input string array - char compareSentence[].
          output:strcmp value.
  */
  int breakSentence_andCompare(char userSentence[] , char compareSentence[])
  {
      int i = 0;
      int z = 0;
      int len = 0;
      int cmp = 0;
      len = strlen(userSentence);
      len -= 1;
      for (i = len ; i &gt;= 0 ; i--)
      {
          compareSentence[z] = userSentence[i];
          printf("%s",compareSentence);   
          z++;    
      }
      printf("\nuser: %s! compare: %s!",userSentence,compareSentence);
      cmp = strcmp(userSentence,compareSentence);
      printf("\n%d",&amp;cmp);
      return cmp;
  }
  </code></pre>
  
  <hr>
  
  <p>This program checks if inputted string is palindrome,
  To simply explain how it works:</p>
  
  <ol>
  <li>It takes user input - String.</li>
  <li>It Takes the user string and input is backwards in another string.</li>
  <li>It compares the strings.</li>
  </ol>
  
  <p>I have a really strange problem in the function and that's the <code>strcmp</code> return value. For some reason, when both strings have the same characters like ABBA the strcmp will return that the value of one of them is bigger.  I'd really love to know what is the problem and how can I fix it.</p>
  
  <p>P.S
  When I were searching the problem I thought that it might be connected to fact that the user input string might contain <code>\n</code> from the enter key; is that possible?</p>
  
  <p>And please understand that this isn't a whole code. The code is missing the output part.</p>