Can std::vector<char> be processed as an array in this way:
std::vector<char>
std::vector<char> v(10); strncpy(&v[0], "hello", 9); // <-- Is this safe?
Yes this good. Starting with C ++ 03, vector requires continuous storage.
vector
As in C ++ 11, the same is true for std::string , by the way; and you can say v.data() as a synonym for &v[0] (which is also true if v empty).
std::string
v.data()
&v[0]
v