Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

representing BLOBs in C++

Tags:

c++

stl

blob

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?

like image 713
Baruch Avatar asked Dec 12 '22 02:12

Baruch


1 Answers

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

like image 184
Attila Avatar answered Dec 30 '22 02:12

Attila