boost - How to save strings in array after tokenizing it c++? -
my input.txt file looks this. "55.2""4""1""0""d""e""a" so wrote small cpp tokenize boost. #include <iostream> // cout, endl #include <fstream> // fstream #include <vector> #include <string> #include <algorithm> // copy #include <iterator> // ostream_operator #include <boost/tokenizer.hpp> int main() { using namespace std; using namespace boost; string data("input.txt"); ifstream in(data.c_str()); if (!in.is_open()) return 1; typedef tokenizer< escaped_list_separator<char> > tokenizer; vector< string > vec; string line; while (getline(in,line)) { tokenizer tok(line); vec.assign(tok.begin(),tok.end()); if (vec.size() < 1) continue; copy(vec.begin(), vec.end(), ostream_iterator<string>(cout, "-")); cout ...