title: Use print function for output of overloaded << operator?
body: <p>I have successfully overloaded the '&lt;&lt;' operator which I believe is referred to as the insertion operator.  I have a print function which prints the information of an instance of a card object, how can I call this print function when the operator is used </p>
  
  <p>example:</p>
  
  <pre><code>Card aCard("Spades",8);  //generates an 8 of spades card object
  
  aCard.Print(); // prints the suit and value of card
  
  cout &lt;&lt; aCard &lt;&lt; endl;  // will print something successfully but how can I get the same results as if I were to call the print function?
  </code></pre>
  
  <p>In my implementation file <code>card.cpp</code> I have overloaded the &lt;&lt; for use with my card class.</p>
  
  <p>Card.cpp </p>
  
  <pre><code>void Card::Print()
  {
      std::cout &lt;&lt; "Suit: "&lt;&lt; Suit &lt;&lt; std::endl;
      std::cout &lt;&lt; "Value:" &lt;&lt; Value &lt;&lt; std::endl;
  }
  
  std::ostream&amp; operator&lt;&lt;(std::ostream &amp;out, const Card &amp;aCard)
  {
      Print();//this causes an error in the program
  }
  </code></pre>
  
  <p>Card.h</p>
  
  <pre><code>class Card
  {
  public:       
      std::string Suit;
      int Value;
  
      Card(){};
      Card(std::string S, int V){Suit=S; Value=V};
  
      void Print();
  
      friend std::ostream&amp; operator&lt;&lt;(std::ostream&amp;, const Card&amp;)
  };
  </code></pre>