title: Creating my own strcmp () function in C
body: <p>I was assigned by my teacher to write my own <code>strcmp()</code> function in C. I did create my own version of said function, and I was hoping to get some feedback.</p>
  
  <pre><code>int CompareTwoStrings ( char *StringOne, char *StringTwo ) {
      // Evaluates if both strings have the same length.
      if  ( strlen ( StringOne ) != strlen ( StringTwo ) ) {
          // Given that the strings have an unequal length, it compares between both
          // lengths.
          if  ( strlen ( StringOne ) &lt; strlen ( StringTwo ) ) {
              return ( StringOneIsLesser );
          }
          if  ( strlen ( StringOne ) &gt; strlen ( StringTwo ) ) {
              return ( StringOneIsGreater );
          }
      }
      int i;
      // Since both strings are equal in length...
      for ( i = 0; i &lt; strlen ( StringOne ); i++ ) {
          // It goes comparing letter per letter.
          if  ( StringOne [ i ] != StringTwo [ i ] ) {
              if  ( StringOne [ i ] &lt; StringTwo [ i ] ) {
                  return ( StringOneIsLesser );
              }
              if  ( StringOne [ i ] &gt; StringTwo [ i ] ) {
                  return ( StringOneIsGreater );
              }
          }
      }
      // If it ever reaches this part, it means they are equal.
      return ( StringsAreEqual );
  }
  </code></pre>
  
  <p>StringOneIsLesser, StringOneIsGreater, StringsAreEqual are defined as const int with the respective values: -1, +1, 0.</p>
  
  <p>Thing is, I'm not exactly sure if, for example, my StringOne has a lesser length than my StringTwo, that automatically means StringTwo is greater, because I don't know how <code>strcmp()</code> is particularly implemented. I need some of your feedback for that.</p>