Thread View: comp.std.c++
2 messages
2 total messages
Started by Stan Erickson
Fri, 08 Dec 1995 08:30
Flush and ostrstreams
Author: Stan Erickson
Date: Fri, 08 Dec 1995 08:30
Date: Fri, 08 Dec 1995 08:30
12 lines
669 bytes
669 bytes
Does flush move the buffer pointer back to the start point on an ostrstream? Or is it non-functional? Thanks, Stan. --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Re: Flush and ostrstreams
Author: Steve Clamage
Date: Fri, 08 Dec 1995 16:26
Date: Fri, 08 Dec 1995 16:26
30 lines
1778 bytes
1778 bytes
In article omd@lll-winken.llnl.gov, Stan Erickson <serickson@llnl.gov> writes: > >Does flush move the buffer pointer back to the start point on an >ostrstream? Or is it non-functional? High-level view: The purpose of the ostream flush() function is to send any buffered output characters to the output device. In the case of a strstream, the internal buffer IS the output device, so there can never be anything for flush() to do. That is, just as flushing an ofstream doesn't rewind the external file, flushing an ostrstream doesn't rewind it either. Lower-level view: With traditional iostreams, flush() is a non-virtual member of ostream which is defined to call the virtual sync() function in the streambuf. The sync() function for a strstream has nothing to do, as noted above. The version of iostreams in the draft standard involves more classes and some internal name changes, but the organization is substantially the same. --- Steve Clamage, stephen.clamage@eng.sun.com [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads