title: C - printf doesn't display full string
body: <p>I'm trying to concatenate two strings, separated by a space, by using pointers instead of strcat. I've gotten the concatenation to work but when I try to print the concatenated string it just prints the first string.</p>
  
  <p>CODE:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void){
      char string1[10];
      char string2[10];
      char fullString[21];
  
      char *string1Ptr = string1;
      char *string2Ptr = string2;
      char *fullStringPtr = fullString;
  
      printf("Enter first string: ");
      scanf_s("%s", &amp;string1, 10);
      fflush(stdin);
  
      printf("Enter second string: ");
      scanf_s("%s", &amp;string2, 10);
      fflush(stdin);
  
      for (int i = 0; i &lt; 21; ++i){
          if (i &lt; 10){
              fullStringPtr[i] = string1Ptr[i];
          }
          else if (i == 10){
              fullStringPtr[i] = ' ';
          }
          else if (i &gt; 10){
              fullStringPtr[i] = string2Ptr[i - 11];
          }
      }
  
      printf("%s\n", fullString);
      //printf("%c", fullString[11]);
  
      getchar();
      return (0);
  }
  </code></pre>
  
  <p>If I enter Hello as the first string and World as the second, the printout just reads "Hello." However, if I try to print the character in a specific position in the second string, e.g. fullString[11], I get the character that should be in that position, in this case W.</p>
  
  <p>The second string is obviously there, printf just doesn't print it. Is there something about printf that I'm missing?</p>