title: Finding the highest number in a set of command line arguments in C
body: <p>I'm just starting out with coding and tried to write a simple program in C to find the highest number in a set of command line arguments. The problem I'm having is that it always seems to think that the numbers given in the command line are crazy long. For example running './highest 4' gets the result 32765.</p>
  <p>Replacing the code with &quot;printf(&quot;%i %i %i\n&quot;, argv[1], argv[2], argv[3]);&quot; shows that this is happening right off the bat. For example &quot;./highest 1 2 3&quot; outputs &quot;32765 -975773016 32765&quot; - and even more confusingly these values change each time I run the program. Anyway, I'm stumped. Here's the code:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(int argc, int argv[])
  
  {
      int highest = argv[1];
      for (int i = 1; i &lt; argc; i++)
      {
          if (argv[i] &gt; highest);
          {
              highest = argv[i];
          }
      }
      printf(&quot;%i\n&quot;, highest);
  }
  </code></pre>