home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / C++-7 / DISK4 / SAMPLES / IOSTUTOR / EXIOS113.CP$ / EXIOS113
Encoding:
Text File  |  1991-11-25  |  309 b   |  14 lines

  1. // exios113.cpp
  2. // Binary example 3
  3. #include <fstream.h>
  4. #include <fcntl.h>
  5. #include <io.h>
  6. int iarray[2] = { 99, 10 };
  7. void main()
  8. {
  9.     filedesc fd = _open( "test.dat", _O_BINARY | _O_CREAT | _O_WRONLY 
  10. );
  11.     ofstream ofs( fd );
  12.     ofs.write( (char*)iarray, 4 ); // Exactly 4 bytes written
  13. }
  14.