title: Equivalent of formatted printf (c) to formatted cerr in C++
body: <p>I want an equivalent for <code>printf("%2.2x", var);</code> to <code>cerr&lt;&lt;</code> in C++.<br>
  code:  </p>
  
  <pre><code>typedef unsigned char byte;  
  static byte var[10];  
  for(i=1; i&lt;10; i++)  
     printf("%2.2x", var[i]);
  </code></pre>
  
  <p>The idea is to redirect the debugging to a file like this: <code>./myprog 2&gt;out.txt</code>.<br>
  If I don't ask too much I would like to receive explanations too.<br>
  Thanks!  </p>