vector of chars to char[] code example Example: vector to char array c++ std::vector<int> vec {1, 2, 3}; const int* = vec.data();