Are you looking for operator overloading? Something like:
ostream &operator<<( ostream &out, const DMY &dmy )
{
out << dmy.Date() << dmy.Month() << dmy.Year();
return out;
}
Edit:
maybe I misunderstood your question a bit. Here is a good link to show you how
WritingStreamManipulators.html[
^]