operator<< recursion

O

OMouse

Hi, I have a node class as part of a tree class. When I << the node, I
want it to also continue to the next node in the chain and output that
one till a NULL has been reached.

This is what I have so far.

ostream& operator<<(ostream &out, xmlElement &outElement)
{
out << "Blah\n";
if (outElement.getFirst() != NULL)
operator<<(out, *outElement.getFirst());
return out;
}

Thanks for any help,
Rudolf/OMouse
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top