title: c++ Hex Array appends characters
body: <p>I have a char array storing hex</p>
  
  <pre><code>char peer0_0[]  = {0xc1, 0x02, 0x06, 0x08, 0x00, 0x5e, 0x84};
  </code></pre>
  
  <p>I try and read the value in a log</p>
  
  <pre><code>std::stringstream ss2;
  ss2 &lt;&lt; std::hex;
  for (int i(0) ; i&lt;8 ; ++i)
      ss2 &lt;&lt; (int)peer0_0[i] &lt;&lt; ' ';
  m_manager-&gt;log(ss2.str(),HIGH_IMPORTANCE);
  </code></pre>
  
  <p>The result is </p>
  
  <pre><code>ffffffc1 2 6 8 0 5e ffffff84 0 
  </code></pre>
  
  <p>I don't understand why it appends 'ffffff' before only two values and not others? Also why is there a zero in the end? Is this a problem of reading? Please help.</p>