Which is a better c++ container for holding and accessing binary data?
std::vector
or
std::string
As far as readability is concerned, I prefer std::vector. std::vector should be the default container in this case: the intent is clearer and as was already said by other answers, on most implementations, it is also more efficient.
On one occasion I did prefer std::string over std::vector though. Let's look at the signatures of their move constructors in C++11:
vector (vector&& x);
string (string&& str) noexcept;
On that occasion I really needed a noexcept move constructor. std::string provides it and std::vector does not.