title: std::ostream need help with function
body: <p>i need someone who explain me these lines of code part by part and i need some help in using "ostream" with simple examples. thank you :).</p>
  
  <pre><code>inline std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, const Telegram&amp; t)
  {
    os &lt;&lt; "time: " &lt;&lt; t.DispatchTime &lt;&lt; "  Sender: " &lt;&lt; t.Sender
       &lt;&lt; "   Receiver: " &lt;&lt; t.Receiver &lt;&lt; "   Msg: " &lt;&lt; t.Msg;
  
    return os;
  }
  </code></pre>
  
  <p>UPDATE 1: when i use this function it doesnt compile and the error says: </p>
  
  <p>std::ostream&amp; class::operator&lt;&lt;(std::ostream&amp; os, const Telegram&amp; t) must take exactly one argument</p>