title: how to print char array in c++
body: <p>how can i print a char array such i initialize and then concatenate to another char array? Please see code below</p>
  
  <pre><code>int main () {
  char dest[1020];
  char source[7]="baby";
  cout &lt;&lt;"source: " &lt;&lt;source &lt;&lt;endl;
  cout &lt;&lt;"return value: "&lt;&lt;strcat(dest, source) &lt;&lt;endl;
  cout &lt;&lt; "pointer pass: "&lt;&lt;dest &lt;&lt;endl;
  return 0;
  }
  </code></pre>
  
  <p>this is the output</p>
  
  <pre><code>source: baby
  return value: v����baby
  pointer pass: v����baby
  </code></pre>
  
  <p>basically i would like to see the output print </p>
  
  <pre><code>source: baby
  return value: baby
  pointer pass: baby
  </code></pre>