The istringstream takes a string, and a string can be made from two char iterators, like this:
istringstream iss(string(v.begin(), v.end()));
Question
currently I am using a boost char array
boost::array<char, 512> received_data;
std::istringstream ss_(received_data.data());
but what if my received_data was a std::vector<char> received_data(512);
how would I then get this data to my std::istringstream ss_
?
La solution
The istringstream takes a string, and a string can be made from two char iterators, like this:
istringstream iss(string(v.begin(), v.end()));
Autres conseils
std::vector<char> receivedData(512);
std::istringstream iss(&receivedData[0]);