title: Checking printf output in CppUnit
body: <p>Let's say I have a simple <code>HelloWorld</code> class with a <code>hi()</code> method with the following single line of code:</p>
  
  <pre><code>void HelloWorld::hi(){
      printf("Hi!\n");
  }
  </code></pre>
  
  <p>Now let's say I want to test that method with CppUnit. </p>
  
  <pre><code>void HelloWorldTests::testHi() {
      HelloWorld hw;
      hw.hi(); // &lt;------ ????
      // &lt;------ ?????
      CPPUNIT_ASSERT(/*????*/);
  }
  </code></pre>
  
  <p>How would I catch the output of the <code>hi()</code> method so that I can compare it to a fixed value in CppUnit?</p>