title: Print an OpenCL cl_uchar in hex format using cout in C++?
body: <p>I'm trying to verify my pointers are in place and I'd like to print the value of a <code>cl_uchar</code> (unsigned char OpenCL type) in hex format.  I tried:</p>
  
  <p><code>cout &lt;&lt; "Data matrix 0,3 = " &lt;&lt; clMatrixPerm-&gt;data_matrix-&gt;elements[4] &lt;&lt; endl;</code></p>
  
  <p>and</p>
  
  <p><code>cout &lt;&lt; "Data matrix 0,3 = " &lt;&lt; hex &lt;&lt; clMatrixPerm-&gt;data_matrix-&gt;elements[4] &lt;&lt; endl;</code></p>
  
  <p>where <code>clMatrixPerm-&gt;data_matrix-&gt;elements[4]</code> is the data in the array to be printed. In both cases there was no output after <code>Data matrix 0,3 =</code>.  I was able to use a workaround with printf so I know the data is being assigned correctly, but I'd like to print it using cout if possible.</p>