home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / cdactual / demobin / share / program / C / ANSICPP.ZIP / EX10019.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-24  |  280 b   |  17 lines

  1. // ex10019.cpp
  2. // The write member function
  3. #include <fstream.h>
  4.  
  5. class Date    {
  6.     int mo, da, yr;
  7. public:
  8.     Date(int m, int d, int y) { mo = m; da = d; yr = y; }
  9. };
  10.  
  11. main()
  12. {
  13.     Date dt(6, 24, 40);
  14.     ofstream tfile("date.dat");
  15.     tfile.write((char *) &dt, sizeof dt);
  16. }
  17.