I am parsing a string in C++ using the following:
using namespace std;
string parsed,input=\"text to be parsed\";
stringstream input_stringstream(input);
i
std::vector parse(std::string str,std::string delim){
std::vector tokens;
char *str_c = strdup(str.c_str());
char* token = NULL;
token = strtok(str_c, delim.c_str());
while (token != NULL) {
tokens.push_back(std::string(token));
token = strtok(NULL, delim.c_str());
}
delete[] str_c;
return tokens;
}