title: Why there is no output from `cout` but it is ok for `printf`
body: <p>To clear illustrate the problem, here is a minimal code. Why there is no output for my line <code>cout &lt;&lt; z &lt;&lt; endl;</code>? I am running it on Mac OS, compiler is <code>Apple clang version 12.0.0 (clang-1200.0.32.29) Target: x86_64-apple-darwin20.3.0</code></p>
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  int main() {
    int x = 15;
    int *y = &amp;x;
    unsigned char *z = (unsigned char *)&amp;x;
    cout &lt;&lt; y &lt;&lt; endl; //this line works OK
    cout &lt;&lt; z &lt;&lt; endl; //no output of this line
    printf(&quot;%x&quot;, z); // this line works OK
    return 0;
  }
  </code></pre>