title: C: Segmentation Fault When Reversing String
body: <pre><code>    void reverse_String(char a[], int start, int length){
      int i;
      int j = length;
      for(i = start; i != j ; i++, j--){
          a[i] ^= a[j];
          a[j] ^= a[i];
          a[i] ^= a[j];
      }
      printf("%s", a);
     }
  
  int main(int argc, char *argv[]){
      int length;
      char word[strlen(argv[1])];
      strcpy(word,argv[1]);
      length = strlen(word);
      reverse_String(word,0,length);
      return 0;
  }
  </code></pre>
  
  <p>Why am I getting a Segmentation Fault for some entries, but it works for others? (Argv[1] is any String entered)</p>