title: How to use C++ std::ostream with printf-like formatting?
body: <p>I am learning C++. <code>cout</code> is an instance of <code>std::ostream</code> class. 
  How can I print a formatted string with it?</p>
  
  <p>I can still use <code>printf</code>, but I want to learn a proper C++ method which can take advantage of all C++ benefits. I think this should be possible with <code>std::ostream</code>, but I can't find the proper way.</p>