home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12449 < prev    next >
Encoding:
Text File  |  1992-08-17  |  839 b   |  23 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!stanford.edu!lucid.com!lucid.com!jss
  3. From: jss@lucid.com (Jerry Schwarz)
  4. Subject: Re: Binary Stream IO
  5. Message-ID: <1992Aug17.230357.7892@lucid.com>
  6. Sender: usenet@lucid.com
  7. Reply-To: jss@lucid.com (Jerry Schwarz)
  8. Organization: Lucid, Inc.
  9. References: <1992Aug13.152405.16170@ucc.su.OZ.AU> <593@lax.lax.pe-nelson.com> <1992Aug17.164623.12017@mksol.dseg.ti.com> <1992Aug17.182148.955@news2.cis.umn.edu>
  10. Date: Mon, 17 Aug 92 23:03:57 GMT
  11. Lines: 10
  12.  
  13. |> Is there a way to do Binary i/o with the stream classes?  In other words, can I
  14. |> do "oFile << double_value" in such a way that double_value is stored using its
  15. |> binary representation rather than as an ascii string?
  16.  
  17.  
  18. You can't use an inserter(<<) operator but you can do
  19.  
  20.     oFile.write(double_value,sizeof(double_value))
  21.  
  22.   -- Jerry Schwarz
  23.