Binary IOStreams

Discussion in 'C++' started by Guest, Aug 31, 2004.

  1. Guest

    Guest Guest

    No doubt this is another noobish kinda inquiry but here goes.

    Is it possible or even desired to use IOStreams (in my case, out of academic
    interest, network sockets) in a binary fashion? Right now it seems as I pull
    single elements out of the stream ('>>') I"m not getting white space.

    TY
     
    Guest, Aug 31, 2004
    #1
    1. Advertising

  2. Guest

    Sharad Kala Guest

    <> wrote in message news:tsVYc.56175$jZ5.8187@clgrps13...
    > No doubt this is another noobish kinda inquiry but here goes.
    >
    > Is it possible or even desired to use IOStreams (in my case, out of

    academic

    Of course it is.

    > interest, network sockets) in a binary fashion? Right now it seems as I

    pull
    > single elements out of the stream ('>>') I"m not getting white space.


    Open your stream specifying std::ios::binary.

    -Sharad
     
    Sharad Kala, Aug 31, 2004
    #2
    1. Advertising

  3. Guest

    Sharad Kala Guest

    "Sharad Kala" <> wrote in message
    news:...
    >
    >
    > Open your stream specifying std::ios::binary.


    btw, generally shift operators are used for formatted i/o and different
    functions are used for (unformatted) binary input/output.

    -Sharad
     
    Sharad Kala, Aug 31, 2004
    #3
  4. <> wrote in message news:tsVYc.56175$jZ5.8187@clgrps13...
    > No doubt this is another noobish kinda inquiry but here goes.
    >
    > Is it possible or even desired to use IOStreams (in my case, out of academic
    > interest, network sockets) in a binary fashion? Right now it seems as I pull
    > single elements out of the stream ('>>') I"m not getting white space.


    Use the unformatted i/o functions, such as read and write, rather than the shift
    operators.

    Jonathan
     
    Jonathan Turkanis, Aug 31, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?S=F6ren?=

    passing around iostreams

    =?ISO-8859-1?Q?S=F6ren?=, Jul 26, 2003, in forum: C++
    Replies:
    3
    Views:
    421
    =?ISO-8859-1?Q?S=F6ren?=
    Jul 27, 2003
  2. Anthony
    Replies:
    3
    Views:
    436
    Javier Estrada
    Oct 8, 2003
  3. Dave O'Hearn
    Replies:
    10
    Views:
    626
    Dave O'Hearn
    Nov 25, 2003
  4. Replies:
    5
    Views:
    3,059
    Richard Herring
    Aug 4, 2004
  5. Guest

    IOStreams

    Guest, Sep 4, 2004, in forum: C++
    Replies:
    9
    Views:
    656
    Guest
    Sep 6, 2004
Loading...

Share This Page