C++ – representing BLOBs in C++

blobcstl

Are there any STL containers that seem to be well-suited for using as BLOBs for database software? I would think a vector<char>, but is there something better? Maybe a std::string? Or some non-STL container?

Best Answer

The BLOB type of databases allows storage of binary data, so you need an ordered collection of bytes. The easiest choice would be a vector<> and you could chose unsigned char to represent a byte on most platforms