This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ios::binary



Under unix, binary file IO is always the case.  Note that in the iostreams
library, binary means the same thing it means in ftp ... do not convert
line ends.  therefore:

{
  int i = 32;
  ofstream str("tempfile");
  str << i << endl;
}
{
  char ch;
  ifstream str("tempfile");
  str >> ch;
  cout << ch << endl;
}

will output the number 3, not a space, regardless of the binary flag.

--------
Where do you want to crash, toady?
On Tue, 3 Nov 1998, Thomas Matelich wrote:

> So, binary file IO is unsupported?  Or am I mistaken?
> 
> --
> Thomas O Matelich
> Senior Programmer
> Zetec, Inc.
> tmatelich@zetec.com
> tomsara@slip-stream.net
> 
> 
> 
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]