Listing 6 Output operator for str using an iterator object

ostream &operator<<(ostream &os, strq &q)
       {
       str *ps;
       strq::iterator sqi(q);
       while ((ps = sqi.next()) != 0)
              os << ' ' << *ps;
       return os;
       }

/* End of File */