stream write

Discussion in 'C++' started by chiku, May 7, 2009.

  1. chiku

    chiku Guest

    Hi,
    I want to implement write function to a fstream object that takes a
    buffer and no. of bytes written and return number of bytes
    successfully written .

    Any code snippet will be appreciated .
     
    chiku, May 7, 2009
    #1
    1. Advertisements

  2. chiku

    Guest

    On May 6, 5:17 pm, chiku <> wrote:
    > Hi,
    > I want to implement write function to a fstream object that takes a
    > buffer and no. of bytes written and return number of bytes
    > successfully written .
    >
    > Any code snippet will be appreciated.


    std::eek:stream& std::eek:stream::write (const char* s, std::streamsize n)
    Always writes n bytes unless an error occurs, in which case the number
    of bytes written may not be obtainable. (Anyone know if you can use
    the seekp to know number of bytes written when badbit is set? I'd
    imagine no.)
     
    , May 7, 2009
    #2
    1. Advertisements

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. Rasmusson, Lars
    Replies:
    1
    Views:
    957
    popov
    Apr 30, 2004
  2. Replies:
    9
    Views:
    904
    Alex Buell
    Apr 27, 2006
  3. Alexander Korsunsky

    get stream mode flags from an opened stream

    Alexander Korsunsky, Feb 17, 2007, in forum: C++
    Replies:
    1
    Views:
    633
    John Harrison
    Feb 17, 2007
  4. dolphin
    Replies:
    6
    Views:
    754
    Thomas Fritsch
    Mar 18, 2007
  5. mrstephengross
    Replies:
    3
    Views:
    565
    James Kanze
    May 10, 2007
  6. Kashif Ur Rehman
    Replies:
    2
    Views:
    1,032
    Tom Hawtin
    May 17, 2007
  7. Anand Hariharan

    Why no diagnostic for stream << stream?

    Anand Hariharan, Mar 17, 2009, in forum: C++
    Replies:
    2
    Views:
    370
    Anand Hariharan
    Mar 18, 2009
  8. Roedy Green

    byte stream vs char stream buffer

    Roedy Green, May 7, 2014, in forum: Java
    Replies:
    20
    Views:
    700
    Silvio
    May 18, 2014
Loading...