Streambuf problems
-
I construct a Streambuf with "an array of char". and use the steambuf to construct a ostream/istream:strm. But the strm cannot do anything with "char array".like << | >> doesn't affect the char array data. Have I missed something?
-
I construct a Streambuf with "an array of char". and use the steambuf to construct a ostream/istream:strm. But the strm cannot do anything with "char array".like << | >> doesn't affect the char array data. Have I missed something?
Without source code, it's hard to say. The streams shouldn't see a char array, but a streambuf. It's up to the streambuf to provide the functionality the stream needs for its internal use. The streaming operators << and >> work on streams, not streambuf. For instance, when streaming a character out (
strm << 'o';
) the ostream will callstreambuf::sputc
to add it to the buffer.modified on Wednesday, September 7, 2011 7:37 AM