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. Advertising

  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. 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. Rasmusson, Lars
    Replies:
    1
    Views:
    724
    popov
    Apr 30, 2004
  2. Replies:
    9
    Views:
    618
    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:
    444
    John Harrison
    Feb 17, 2007
  4. dolphin
    Replies:
    6
    Views:
    545
    Thomas Fritsch
    Mar 18, 2007
  5. mrstephengross
    Replies:
    3
    Views:
    392
    James Kanze
    May 10, 2007
Loading...

Share This Page