title: How do I handle argv character array assignments?
body: <p>I found two ways of passing command-line arguments into a character array:</p>
  
  <pre><code>int main (int argc, char **argv)
  {
    const char *s1 = argv[0];
    char s2[256];
    strcpy(s2, argv[0]);
  
    printf("s1: %s\ns2: %s\n\n", s1, s2);
  }
  </code></pre>
  
  <p>Compiled with the IBM xlc compiler on an AIX system Returns</p>
  
  <blockquote>
    <p>[MyPrompt]> ./a.out</p>
    
    <p>s1: ./a.out </p>
    
    <p>s2: ./a.out</p>
  </blockquote>
  
  <p>Which implementation (s1 or s2) is correct?  s1 is nice because argv[0] can be any length.  s2 requires that the length of argv[0] &lt; 256 characters.</p>
  
  <p>I do not understand how/why s1 should work.  I <em>think</em> the right-hand side of s1 should be required at compile time, but I <em>think</em> it's generated at run-time.</p>