Overloading << operator in linked list
<p>I am having trouble creating the overloading coding for this. Not really sure where to start or how to even start. I am new to c++ and having trouble understanding linked lists and nodes, even after doing reading on this. this is what I have so far.</p>

<pre><code>#include "LList.h"
#include &lt;iostream&gt;

using namespace std;

std::ostream&amp; operator&lt;&lt;(ostream&amp; out, const LList&amp; llist);

int main( )
{
LList a;

a.push_back(  "30" );
a.push_front( "20" );
a.push_back(  "40" );
a.push_front( "10" );
a.push_back(  "50" );

cout &lt;&lt; "list a:\n" &lt;&lt; a &lt;&lt; '\n';

return 0;

}

ostream &amp;operator &lt;&lt;( ostream &amp;out, const LList&amp; llist )
{
LList ::          //not sure what to really put from here

return out;
}
</code></pre>

<p>here is the screenshot<img src="http://i.stack.imgur.com/We0Ye.jpg" alt="enter image description here"></p>

<p>LList.h</p>

<pre><code>#ifndef LList_h
#define LList_h

#include &lt;iostream&gt;
#include "node.h"


class LList
{
public:
LList(void);            //constructor
LList(const LList &amp;);   //copy constructor
~LList();           //destructor
LList *next;            //points to next node
void push_back(const string &amp;str);
void push_front(const string &amp;str);
friend ostream&amp; operator&lt;&lt;(ostream&amp; out, const LList&amp; llist);
LList &amp;operator=(const LList &amp;);        

private:
Node *_head;
Node *_tail;
LList *front;       //points to front of the list

};

inline LList::LList(void)
{
cerr &lt;&lt; "default constructor";
}

inline void LList::push_back(const string &amp;str)
{
Node *p = new Node(str);
if (_tail == 0)
{
    _head = _tail = p;
}
else
{
    _tail -&gt;next(p);
    _tail = p;
}
if (_head == 0)
{
    _head = _tail = p;
}
else
{
    _head -&gt;next(p);
    _head = p;
}
}

inline void LList::push_front(const string &amp;str)
{
Node *p = new Node(str);
if (_tail == 0)
{
    _head = _tail = p;
}
else
{
    _tail -&gt;next(p);
    _tail = p;
}
if (_head == 0)
{
    _head = _tail = p;
}
else
{
    _head -&gt;next(p);
    _head = p;
}

}

inline LList::~LList( )
{
Node *p = new Node (str);

if ( _head == 0)
{
    _head = p;
}
else
{
Node *q;
//&amp;Node::next;
    for (q = _head; q-&gt;next(); q = q -&gt; next)
{
    //loop until we have
    //q pointing to the last node
}
q-&gt;next ( p);   //last node points to p
}       //_uead still points to the first node

}

#endif
</code></pre>

<p>I'm not really sure where I am at with this. I'm just trying things and getting some ideas from some of the examples from my professor</p>
