title: stdout silent failure
body: <p>I'm trying to output a zlib compressed string to stdout and something really strange happens. After running the zlib deflate operation successfully (all the correct return values checked), I try to output the result unformatted with either of these methods:</p>
  
  <pre><code>fwrite((void*)output, 1, numbytes, stdout);
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>for(int i=0; i != numbytes; ++i)
      cout.put(output[c]);
  if(!cout.good())
      throw error();
  </code></pre>
  
  <p>In either case nothing is output and stdout is broken. In the case of the iostream code, cout.good() returns true, no failbits are set! When using fwrite I check ferror and thats fine too!!! By stdout being broken, I mean that nothing is output via stdout for the rest of the app session. I tried reseting the stdout error state with the respective interfaces to no avail.</p>
  
  <p>I'm strongly inclined to believe this is a library error, as something like this really shouldn't malfunction silently.</p>
  
  <p>All this is happening under OSX 10.6 running XCode 4.2.</p>