title: comparing length of strings C
body: <p>I'm having trouble with comparing strings in C. Firstly, I need to find the length of each string from command-line arguments, and then compare them as well as printing the biggest one. </p>
  
  <p>So far, it's just printing the length of each typed string. I need to compare them according to length, not alphabetic order. </p>
  
  <p>I don't understand why is it now working and what I should do fix it? Thank you!</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main(int argc, char *argv[])
  {
      int i, length;
  
      for(i = 0; i&lt;argc; i++)
      {
          length = strlen(argv[i]);
          printf("%s %d\n", argv[i], length);
  
          if(strlen(argv[i]) &lt; strlen(argv[i+1]))
          {
              printf("%s is the biggest \n", argv[i+1]);
          }
          else
          {
              printf("%s is the biggest \n", argv[i]);
          }
      }
      return 0;
  }
  </code></pre>