title: c++ printing unsigned char values
body: <p>Consider the following:</p>
  
  <pre><code>int main() {
      unsigned char val(-1); 
      printf( "val = %u\n", val );
      return 0;
  }
  </code></pre>
  
  <p>Ouptut:</p>
  
  <pre><code>val = 255
  </code></pre>
  
  <p>However when I try to use <code>iostream</code></p>
  
  <pre><code>int main() {
      unsigned char val(-1);
      std::cout &lt;&lt; "val = " &lt;&lt; val &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>val = 
  </code></pre>
  
  <p>Yet in the debugger when I check <code>val</code> it has the value <code>255</code> with the <code>y</code> with double dots above the <code>y</code>.</p>
  
  <p>How can I get <code>iostream</code> to print out the same as <code>printf()</code> with the value of <code>255</code></p>