我使用的接收数据作为图书馆vector的char秒.我需要传递string给图书馆.
我想使用std::vector接受迭代器的构造函数来执行转换 - 但是想知道是否有更好的方法呢?
/*Note: json_str is of type std::string*/
const std::vector<char> charvect(json_str.begin(), json_str.end());
Run Code Online (Sandbox Code Playgroud) c++ ×1