stream write

C

chiku

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

joshuamaurice

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top