Stream Insertion Operator overloading
<p>Im really unsure how to call the function:</p>

<pre><code>friend ostream&amp; operator&lt;&lt;(ostream&amp; out, stack::myItem&amp; theItem);
</code></pre>

<p>that is public to my stack object:</p>

<pre><code>class stack
{
public:
    stack(int capacity);
    ~stack(void);
     void method1();
     ...

private:

    struct myItem
    {
        int             item;
    };

      ...
public:
    friend ostream&amp; operator&lt;&lt;(ostream&amp; out, stack&amp; s);
    friend ostream&amp; operator&lt;&lt;(ostream&amp; out, stack::myItem&amp; theItem);
};
</code></pre>
