title: How do I split a string in half without using pointers
body: <p>I want to type in a string, which always has a even amount of letters in it. I want it to print out the string but devide in half and connected with "-" in between. I manage to print out the first half of the word, but not the last one. </p>
  
  <p>I have tried and make a for loop that starts in the middle of the user_input and is supposed to put in each letter in the string "right".</p>
  
  <pre><code>int main() {
  
      char user_input[STRING_LENGTH] = { 0 };
      char left[STRING_LENGTH];
      char right[STRING_LENGTH];
  
      int lenght, mid, i;
  
      printf("Please type in a string: ");
  
      fgets(user_input, STRING_LENGTH, stdin);
      user_input[strlen(user_input) - 1] = 0;
  
      lenght = strlen(user_input);
      mid = lenght/2;
      for (i = 0; i &lt; mid; ++i) {
          left[i] = user_input[i];
      }
  
      for (i = lenght; i &lt; mid; --i) {
          right[i] = user_input[i];
      }
  }
  </code></pre>
  
  <p>The expected result if input is 'airplane' would be 'airp - lane'.</p>