c++ - unformatted i/o to and from memory -


i'm looking way write unformatted data memory using c++ standard library. i'd class inherits istream/ostream , works ifstream/ofstream, backed memory instead of file on disk.

this way can work istreams , ostreams , use operator<< , operator>> read/write binary data, , don't need know whether data streaming memory or onto disk.

i thought perhaps istringstream/ostringstream configured write unformatted output via operator<< , operator>>, couldn't see simple way this.

so wasn't able find in c++ standard library or in boost, seems sort of thing should there. advice appreciated!

you can't use << , >> operators write/read unformatted data (they dealing textual input , output), can use write method of output streams , read method of input streams.

and std::string don't care data holds should able use stringstream (and output/input variants).


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -