Category : C++ Source Code
Archive   : TEACHCPP.ZIP
Filename : EX10020.CPP

 
Output of file : EX10020.CPP contained in archive : TEACHCPP.ZIP
// ex10020.cpp
// The read member function
#include

class Date {
int mo, da, yr;
public:
Date() { }
friend ostream& operator<< (ostream& os, Date& dt);
};

ostream& operator<< (ostream& os, Date& dt)
{
os << dt.mo << '/' << dt.da << '/' << dt.yr;
return os;
}

main()
{
Date dt;
ifstream tfile("date.dat");
tfile.read((char *) &dt, sizeof dt);
cout << dt;
}


  3 Responses to “Category : C++ Source Code
Archive   : TEACHCPP.ZIP
Filename : EX10020.CPP

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/