title: C++: strcpy Function copies null?
body: <p>While using string manipulation functions specificaly <code>strcpy</code> I did this small program.</p>
  
  <pre><code>char s1[8]="Hellopo";
  char s2[4]="sup";
  strcpy(s1,s2);
  cout&lt;&lt;s1&lt;&lt;endl;
  </code></pre>
  
  <p>When I printed out s1 It actually just printed out "sup". I expected it to print "suplopo".</p>
  
  <p>Then I did this:</p>
  
  <p><code>cout&lt;&lt;s1+4 &lt;&lt; endl;</code></p>
  
  <p>It printed out "opo";</p>
  
  <p>And The output of this: <code>cout&lt;&lt;s1+3&lt;&lt;endl;</code>  was nothing </p>
  
  <p>So after thinking a bit about it. </p>
  
  <p>I came to this conclusion. Since C++ stops outputing the string once it reaches the null terminator. Therefore the null must have been copied in the <code>strcpy</code> function. Resulting in this string:</p>
  
  <p>s - u - p - \0 - o - p - o -\0;</p>
  
  <p>Please tell me if this is correct or not. And if im not please correct me.</p>
  
  <p>And if you have any more info to provide please do.</p>