title: loop to reverse string in C
body: <p>So I've looked around on SO and can't find code that answers my question.  I have written a function that is supposed to reverse a string as input in cmd-line.  Here is the function:</p>
  
  <pre><code>void reverse (char string[]) {
      int x;
      int i = 0;
      char line[strlen(string)];
  
      for (x = strlen(string) - 1; x &gt; 0; x--) {
          char tmp = string[x];
          line[i] = tmp;
          i++;
      }
      string = line;
  }
  </code></pre>
  
  <p>When I call my reverse() function, the string stays the same.  i.e., 'abc' remains 'abc'</p>
  
  <p>If more info is needed or question is inappropriate, let me know.</p>
  
  <p>Thanks!!</p>