Stupid new iostream question: binary 
Author Message
 Stupid new iostream question: binary

Using the old iostreams, I could write a line of code like:

    cerr << binary;

and it would set the stream to use binary output (no "new line" to "crlf "
translation).

What is the equivalent in the new iostreams?
There doesn't seem to be a ios& binary(ios& _fstrm) function like there was
in the old fstream.h

Is there a way to set binary mode on a file stream in the new iostreams?

Obviously, the open() call allows me to set this, but in the case of
cout/cerr,
I don't know the file name they are open to,. if any.



Sat, 16 Apr 2005 01:16:36 GMT  
 Stupid new iostream question: binary

Quote:

> [...]
>     cerr << binary;
> [...]
> What is the equivalent in the new iostreams?
> There doesn't seem to be a ios& binary(ios& _fstrm) function like there was
> in the old fstream.h

  I had never heard of such a feature.

Quote:
> Is there a way to set binary mode on a file stream in the new iostreams?

> Obviously, the open() call allows me to set this,

  Right, actually that's the way to go.

Quote:
>                                                   but in the case of
> cout/cerr,
> I don't know the file name they are open to,. if any.

  But these don't need to be file streams.
  Anyway, I think there's 'read()' and
  'write()' member functions for binary IO.
  Also, you can get the buffer and write
  into that directly.

  HTH,

  Schobi

--

I'm HSchober at gmx dot de



Sun, 17 Apr 2005 21:24:16 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. binary I/O with new iostream classes: how?

2. Binary output doesn't work with new iostream library in 4.2

3. Stupid Question: Hex and Binary Numbers

4. iostreams and binary data

5. New iostream disables warnings?

6. Old versus new iostream?

7. Linking old and new iostream together

8. Continued problems with new iostreams

9. New iostream library

10. Whats the new iostreams i should use

11. new and old iostream lib/link errors

12. new headers and <iostream>

 

 
Powered by phpBB® Forum Software