title: String won't print with cout
body: <p>What I am trying to do is copy two strings to a third one leaving as many spaces in the third one as the sum of the characters of the first two strings without using <code>strcpy</code> or anything similar, the code below won't print the <code>stc</code> string. It runs but it wont print it.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;conio.h&gt;
  #include &lt;string.h&gt;
  
  using namespace std;
  
  int main()
  {
    int i, j = 0, k = 0, str_1 = 0, str_2 = 0, str_3 = 0, space = 0;
    char sta[40];
    char stb[40];
    char stc[100] = { };
  
    cout &lt;&lt; "Enter sentence: " &lt;&lt; endl &lt;&lt; endl;
    cin.getline(sta, 39);
    cout &lt;&lt; "Enter Second Sentence: " &lt;&lt; endl &lt;&lt; endl;
    cin.getline(stb, 39);
  
    for (i = 0; i &lt; 40; i++) {
      if (sta[i] == '\0') {
        break;
      } else {
        str_1++;
      }
    }
    cout &lt;&lt; "The first sentence has: " &lt;&lt; str_1 &lt;&lt; " characters" &lt;&lt; endl &lt;&lt; endl;
  
    for (i = 0; i &lt; 40; i++) {
      if (stb[i] == '\0') {
        break;
      } else {
        str_2++;
      }
    }
    cout &lt;&lt; "The second sentence has: " &lt;&lt; str_2 &lt;&lt; " characters" &lt;&lt; endl &lt;&lt; endl;
  
    space = str_1 + str_2;
    for (i = 0; sta[i] != '\0'; i++) {
      stc[space] = sta[i];
      space++;
      str_3++;
    }
    for (j = 0; stb[j] != '\0'; j++) {
      stc[space] = stb[j];
      space++;
      str_3++;
    }
    stc[space] = '\0';
    cout &lt;&lt; "The third sentence is: " &lt;&lt; stc &lt;&lt; endl &lt;&lt; endl;
    cout &lt;&lt; "And has " &lt;&lt; str_3 &lt;&lt; " characters " &lt;&lt; endl;
    return 0;
  }
  </code></pre>