title: Ostream from multiple classes
body: <p>I seem to be getting the Error C2440: 'return' cannot convert from 'LinkList' to 'Tray *'. What i'm trying to do is add the output of a second class to that of the customer class. So if i was to call a method such as whoIsEating() i could easily get a list of who, where and what. I had an idea of using 'friend' but i'm quite unsure on that.</p>
  
  <p>Customer.h</p>
  
  <pre><code>class Customer
  {
  private:
      int tableNumber;
      std::string firstName;
      std::string lastName;
      LinkList&lt;Tray&gt; *myTray;
  public:
      Customer();
      Customer(std::string sFirstName, std::string sLastName,
          int sTableNumber,
          LinkList&lt;Tray&gt; *myTray = new LinkList&lt;Tray&gt;());
      ~Customer(void);
  
      int gettableNumber();
      Tray* getTray(void);
  </code></pre>
  
  <p>Customer.cpp</p>
  
  <pre><code>Tray* Customer::getTray()
  {
      return *myTray;
  }
  
  ostream&amp; operator &lt;&lt; (ostream&amp; output, Customer&amp; customer)
  {
      output &lt;&lt; customer.getFirstName() &lt;&lt; " " &lt;&lt; customer.getLastName() &lt;&lt; endl
          &lt;&lt; customer.gettableNumber() &lt;&lt; endl
          &lt;&lt; (*customer.getTray()) &lt;&lt; endl; //Edit: Fixed this
      return output;
  </code></pre>
  
  <p>Tray.cpp</p>
  
  <pre><code>ostream&amp; operator &lt;&lt; (ostream&amp; output, Tray&amp; tray)
  {
      output &lt;&lt; "Drink: " &lt;&lt; tray.getdrink() &lt;&lt; endl;
      output &lt;&lt; "Food: " &lt;&lt; tray.getfood() &lt;&lt; endl;
      return output;
  }
  </code></pre>
  
  <p>Suspected output would be like</p>
  
  <p>Name: John Smith</p>
  
  <p>Table Number: 12</p>
  
  <p>Meal Details:</p>
  
  <p>Drink: Tea</p>
  
  <p>Food: Fish &amp; Chips</p>